Lob Versions API
The Versions API from Lob — 2 operation(s) for versions.
The Versions API from Lob — 2 operation(s) for versions.
openapi: 3.0.3
info:
title: Lob Versions API
version: 1.20.2
description: "Experience direct mail like never before, with unmatched personalization and scalability \x14 all in one intuitive platform."
license:
name: MIT
url: https://mit-license.org/
contact:
name: Lob Developer Experience
url: https://support.lob.com/
email: lob-openapi@lob.com
termsOfService: https://www.lob.com/legal
servers:
- url: https://api.lob.com/v1
description: production
security:
- basicAuth: []
tags:
- name: Versions
paths:
/templates/{tmpl_id}/versions/{vrsn_id}:
parameters:
- in: path
name: tmpl_id
description: The ID of the template to which the version belongs.
required: true
schema:
$ref: '#/components/schemas/tmpl_id'
- in: path
name: vrsn_id
description: id of the template_version
required: true
schema:
$ref: '#/components/schemas/vrsn_id'
get:
operationId: template_version_retrieve
summary: Retrieve
description: Retrieves the template version with the given template and version ids.
tags:
- Versions
responses:
'200':
description: Returns the template version with the given template and version ids.
content:
application/json:
schema:
$ref: '#/components/schemas/template_version'
example:
id: vrsn_534e339882d2282
description: Second Version
html: <html>Second HTML for {{name}}</html>
date_created: '2017-11-09T04:49:38.016Z'
date_modified: '2017-11-09T04:49:38.016Z'
object: version
default:
$ref: '#/components/responses/template_error'
x-codeSamples:
- lang: Shell
source: "curl https://api.lob.com/v1/templates/tmpl_c94e83ca2cd5121/versions/vrsn_534e339882d2282 \\\n -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:\n"
label: CURL
- lang: Typescript
source: "try {\n const templateVersion = await new TemplateVersionsApi(config).get('tmpl_xxxx', 'vrsn_xxxx');\n} catch (err: any) {\n console.error(err);\n}\n"
label: TYPESCRIPT
- lang: Javascript
source: 'This feature is not currently supported by this library.
'
label: NODE
- lang: Ruby
source: "templateVersionApi = TemplateVersionsApi.new(config)\n\nbegin\n retrievedTemplateVersion = templateVersionApi.get(\"tmpl_c94e83ca2cd5121\", \"vrsn_534e339882d2282\")\nrescue => err\n p err.message\nend\n"
label: RUBY
- lang: Python
source: "with ApiClient(configuration) as api_client:\n api = TemplateVersionsApi(api_client)\n\ntry:\n template_version = api.get(\"tmpl_c94e83ca2cd5121\", \"vrsn_534e339882d2282\")\nexcept ApiException as e:\n print(e)\n"
label: PYTHON
- lang: PHP
source: "$apiInstance = new OpenAPI\\Client\\Api\\TemplateVersionsApi($config, new GuzzleHttp\\Client());\n\ntry {\n $result = $apiInstance->get(\"tmpl_c94e83ca2cd5121\", \"vrsn_534e339882d2282\");\n} catch (Exception $e) {\n echo $e->getMessage(), PHP_EOL;\n}\n"
- lang: Java
source: "TemplateVersionsApi apiInstance = new TemplateVersionsApi(config);\n\ntry {\n TemplateVersion response = apiInstance.get(\"vrsn_534e339882d2282\");\n} catch (ApiException e) {\n e.printStackTrace();\n}\n"
label: JAVA
- lang: Elixir
source: 'This feature is not currently supported by this library.
'
label: ELIXIR
- lang: CSharp
source: "TemplateVersionsApi api = new TemplateVersionsApi(config);\n\ntry {\n TemplateVersion response = api.get(\"tmpl_c94e83ca2cd5121\", \"vrsn_534e339882d2282\");\n} catch (ApiException e) {\n Console.WriteLine(e.ToString());\n}\n"
label: CSHARP
- lang: Go
source: "var context = context.Background()\ncontext = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv(\"<YOUR_API_KEY>\")})\n\nvar apiClient = *lob.NewAPIClient(configuration)\n\nfetchedTemplateVersion, _, err := apiClient.TemplateVersionsApi.Get(context,\"tmpl_c94e83ca2cd5121\", \"vrsn_534e339882d2282\").Execute()\n\nif err != nil {\n return err\n}\n"
label: GO
post:
operationId: template_version_update
summary: Update
description: Updates the template version with the given template and version ids.
tags:
- Versions
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/template_version_updatable'
example:
description: Some description
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/template_version_updatable'
example:
description: Some description
multipart/form-data:
schema:
$ref: '#/components/schemas/template_version_updatable'
example:
description: Some description
responses:
'200':
$ref: '#/components/responses/post_template_version'
default:
$ref: '#/components/responses/template_error'
x-codeSamples:
- lang: Shell
source: "curl https://api.lob.com/v1/templates/tmpl_c94e83ca2cd5121/versions/vrsn_534e339882d2282 \\\n -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \\\n -d \"description=Updated description\"\n"
label: CURL
- lang: Typescript
source: "const TemplateVersions = new TemplateVersionsApi(config);\n\ntry {\n const updateData = new TemplateVersionUpdatable({\n description: 'updated template'\n });\n const updateTemplateVersion = await TemplateVersions.update('vrsn_xxxx', updateData);\n} catch (err: any) {\n console.error(err);\n}\n"
label: TYPESCRIPT
- lang: Javascript
source: 'This feature is not currently supported by this library.
'
label: NODE
- lang: Ruby
source: "templateVersionUpdatable = TemplateUpdate.new({\n description: \"updated template version\",\n})\n\ntemplateVersionApi = TemplateVersionsApi.new(config)\n\nbegin\n updatedTemplateVersion = templateVersionApi.update(\"tmpl_c94e83ca2cd5121\", \"vrsn_534e339882d2282\", templateVersionUpdatable)\nrescue => err\n p err.message\nend\n"
label: RUBY
- lang: Python
source: "with ApiClient(configuration) as api_client:\n api = TemplateVersionsApi(api_client)\n\nupdate_data = TemplateVersionUpdatable(\n description = \"updated template\"\n)\n\ntry:\n update_template_version = api.update(\"tmpl_c94e83ca2cd5121\", \"vrsn_534e339882d2282\", update_data)\nexcept ApiException as e:\n print(e)\n"
label: PYTHON
- lang: PHP
source: "$apiInstance = new OpenAPI\\Client\\Api\\TemplateVersionsApi($config, new GuzzleHttp\\Client());\n\n$templateVersionUpdate = new OpenAPI\\Client\\Model\\TemplateUpdate(array(\n \"description\" => \"Updated template version\"\n));\n\ntry {\n $result = $apiInstance->update(\"tmpl_c94e83ca2cd5121\", \"vrsn_534e339882d2282\", $templateVersionUpdate);\n} catch (Exception $e) {\n echo $e->getMessage(), PHP_EOL;\n}\n"
- lang: Java
source: 'This feature is not currently supported by this library.
'
label: JAVA
- lang: Elixir
source: 'This feature is not currently supported by this library.
'
label: ELIXIR
- lang: CSharp
source: "TemplateVersionsApi api = new TemplateVersionsApi(config);\nTemplateVersionUpdatable update = new TemplateVersionUpdatable(\"update template\", EngineHtml.Handlebars);\n\ntry {\n api.update(\"tmpl_c94e83ca2cd5121\", \"vrsn_534e339882d2282\", update);\n} catch (ApiException e) {\n Console.WriteLine(e.ToString());\n}\n"
label: CSHARP
- lang: Go
source: "var context = context.Background()\ncontext = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv(\"<YOUR_API_KEY>\")})\n\nvar apiClient = *lob.NewAPIClient(configuration)\n\nvar templateWritable = *lob.NewTemplateWritable(\"<html>Updated HTML for Template 1/html>\")\nvar templateVersionWritable = *lob.NewTemplateVersionWritable(\"<html>Updated HTML for Template 1/html>\")\ncreatedTemplate, _, _ := apiClient.TemplatesApi.Create(context).TemplateWritable(templateWritable).Execute()\n\ncreatedTemplateVersion, _, err := apiClient.TemplateVersionsApi.Create(context, createdTemplate.Id).TemplateVersionWritable(templateVersionWritable).Execute()\ncreatedTemplateVersion.SetDescription(\"New Template Version\")\nresp, _, err := apiClient.TemplatesApi.Update(context, createdTemplate.Id, createdTemplateVersion.Id).TemplateVersionWritable(templateVersionWritable).Execute()\n\nif err != nil {\n return err\n}\n"
label: GO
delete:
operationId: template_version_delete
summary: Delete
description: Permanently deletes a template version. A template's `published_version` can not be deleted.
tags:
- Versions
responses:
'200':
$ref: '#/components/responses/template_version_deleted'
default:
$ref: '#/components/responses/template_error'
x-codeSamples:
- lang: Shell
source: "curl -X DELETE https://api.lob.com/v1/templates/tmpl_4aa14648113e45b/versions/vrsn_534e339882d2282 \\\n -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:\n"
label: CURL
- lang: Typescript
source: "try {\n const deleteTemplateVersion = await new TemplateVersionsApi(config).delete(\"tmpl_xxxx\",\"vrsn_xxxx\");\n} catch (err: any) {\n console.error(err);\n}\n"
label: TYPESCRIPT
- lang: Javascript
source: 'This feature is not currently supported by this library.
'
label: NODE
- lang: Ruby
source: "templateVersionApi = TemplateVersionsApi.new(config)\n\nbegin\n deletedTemplateVersion = templateVersionApi.delete(\"tmpl_4aa14648113e45b\", \"vrsn_534e339882d2282\")\nrescue => err\n p err.message\nend\n"
label: RUBY
- lang: Python
source: "with ApiClient(configuration) as api_client:\n api = TemplateVersionsApi(api_client)\n\ntry:\n deleted_resource = api.delete(\"tmpl_4aa14648113e45b\", \"vrsn_534e339882d2282\")\nexcept ApiException as e:\n print(e)\n"
label: PYTHON
- lang: PHP
source: 'This feature is not currently supported by this library.
'
- lang: Java
source: 'This feature is not currently supported by this library.
'
label: JAVA
- lang: Elixir
source: 'This feature is not currently supported by this library.
'
label: ELIXIR
- lang: CSharp
source: "TemplateVersionsApi api = new TemplateVersionsApi(config);\n\ntry {\n TemplateVersionDeletion response = api.delete(\"tmpl_xxx\", \"vrsn_xxx\");\n} catch (ApiException e) {\n Console.WriteLine(e.ToString());\n}\n"
label: CSHARP
- lang: Go
source: "var context = context.Background()\ncontext = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv(\"<YOUR_API_KEY>\")})\n\nvar apiClient = *lob.NewAPIClient(configuration)\n\ndeletedTemplateVersion, _, err := apiClient.TemplateVersionsApi.Delete(context, \"tmpl_4aa14648113e45b\", \"vrsn_534e339882d2282\").Execute()\n\nif err != nil {\n return err\n}\n"
label: GO
/templates/{tmpl_id}/versions:
get:
operationId: template_versions_list
summary: List
description: 'Returns a list of template versions for the given template ID. The template versions are sorted by creation date, with the most recently created appearing first.
'
tags:
- Versions
parameters:
- in: path
name: tmpl_id
description: The ID of the template associated with the retrieved versions
required: true
schema:
$ref: '#/components/schemas/tmpl_id'
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/before_after'
- $ref: '#/components/parameters/include'
- $ref: '#/components/parameters/date_created'
responses:
'200':
$ref: '#/components/responses/all_template_versions'
default:
$ref: '#/components/responses/template_error'
x-codeSamples:
- lang: Shell
source: "curl -X GET \"https://api.lob.com/v1/templates/tmpl_ea6e6a1abf01703/versions?limit=2\" \\\n -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc:\n"
label: CURL
- lang: Typescript
source: "try {\n const templateVersions = await new TemplateVersionsApi(config).list(tmpl_xxxx);\n} catch (err: any) {\n console.error(err);\n}\n"
label: TYPESCRIPT
- lang: Javascript
source: 'This feature is not currently supported by this library.
'
label: NODE
- lang: Ruby
source: "templateVersionsApi = TemplateVersionsApi.new(config)\n\nbegin\n templateVersions = templateVersionsApi.list(\"tmpl_dadaaf7b76c9f25\", { limit: 2 })\nrescue => err\n p err.message\nend\n"
label: RUBY
- lang: Python
source: "with ApiClient(configuration) as api_client:\n api = TemplateVersionsApi(api_client)\n\ntry:\n template_versions = api.list(\"tmpl_dadaaf7b76c9f25\", limit=2)\nexcept ApiException as e:\n print(e)\n"
label: PYTHON
- lang: PHP
source: "$apiInstance = new OpenAPI\\Client\\Api\\TemplateVersionsApi($config, new GuzzleHttp\\Client());\n\ntry {\n $result = $apiInstance->list(\n tmpl_dadaaf7b76c9f25, // tmplId\n 2, // limit\n );\n} catch (Exception $e) {\n echo $e->getMessage(), PHP_EOL;\n}\n"
- lang: Java
source: "TemplateVersionsApi apiInstance = new TemplateVersionsApi(config);\n\ntry {\n List response = apiInstance.list(\n \"tmpl_dadaaf7b76c9f25\", // tmplId\n 2, // limit\n null, // before\n null, // after\n null, // include\n null // dateCreated\n );\n} catch (ApiException e) {\n e.printStackTrace();\n}\n"
label: JAVA
- lang: Elixir
source: 'This feature is not currently supported by this library.
'
label: ELIXIR
- lang: CSharp
source: "TemplateVersionsApi api = new TemplateVersionsApi(config);\n\nList<string> includeList = new List<string>();\nincludeList.Add(\"total_count\");\nDictionary<String, DateTime> dateCreated = new Dictionary<String, DateTime>();\nDateTime dateCreatedDate = DateTime.Today.AddMonths(-1);\ndateCreated.Add(\"lt\", dateCreatedDate);\n\ntry {\n TemplateVersionList response = api.list(\n \"tmpl_dadaaf7b76c9f25\", // tmplId\n 2, // limit\n null, // before\n null, // after\n includeList, // include\n dateCreated // dateCreated\n );\n} catch (ApiException e) {\n Console.WriteLine(e.ToString());\n}\n"
label: CSHARP
- lang: Go
source: "var context = context.Background()\ncontext = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv(\"<YOUR_API_KEY>\")})\n\nvar apiClient = *lob.NewAPIClient(configuration)\nTemplateVersionList = apiClient.TemplateVersionsApi.List(context, \"tmpl_4aa14648113e45b\").Execute()\nif err != nil {\n return err\n}\n"
label: GO
post:
operationId: create_template_version
summary: Create
description: Creates a new template version attached to the specified template.
tags:
- Versions
parameters:
- in: path
name: tmpl_id
description: The ID of the template the new version will be attached to
required: true
schema:
$ref: '#/components/schemas/tmpl_id'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/template_version_writable'
example:
description: Some Description
html: <html>HTML for {{name}}</html>
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/template_version_writable'
example:
description: Some Description
html: <html>HTML for {{name}}</html>
multipart/form-data:
schema:
$ref: '#/components/schemas/template_version_writable'
example:
description: Some Description
html: <html>HTML for {{name}}</html>
responses:
'200':
$ref: '#/components/responses/post_template_version'
default:
$ref: '#/components/responses/template_error'
x-codeSamples:
- lang: Shell
source: "curl https://api.lob.com/v1/templates/tmpl_4aa14648113e45b/versions \\\n -u test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc: \\\n -d \"description=Second Version\" \\\n --data-urlencode \"html=<html>Second HTML for {{name}}</html>\"\n"
label: CURL
- lang: Typescript
source: "const templateVersionCreate = new TemplateVersionWritable({\n description: 'Newer Template',\n html: '<html>Updated HTML for {{name}}</html>'\n});\n\ntry {\n const myTemplateVersion = await new TemplateVersionsApi(config).create('tmpl_xxxx', templateVersionCreate);\n} catch (err: any) {\n console.error(err);\n}\n"
label: TYPESCRIPT
- lang: Javascript
source: 'This feature is not currently supported by this library.
'
label: NODE
- lang: Ruby
source: "templateVersionCreate = TemplateVersionWritable.new({\n description: \"Second Version\",\n html: \"<html>Second HTML for {{name}}</html>\",\n});\n\ntemplateVersionApi = TemplateVersionsApi.new(config)\n\nbegin\n createdTemplateVersion = templateVersionApi.create(\"tmpl_4aa14648113e45b\", templateVersionCreate)\nrescue => err\n p err.message\nend\n"
label: RUBY
- lang: Python
source: "template_version_writable = TemplateVersionWritable(\n description = \"Second Version\",\n html = \"<html>Second HTML for {{name}}</html>\",\n)\n\nwith ApiClient(configuration) as api_client:\n api = TemplateVersionsApi(api_client)\n\ntry:\n created_template_version = api.create(\"tmpl_4aa14648113e45b\", template_version_writable)\nexcept ApiException as e:\n print(e)\n"
label: PYTHON
- lang: PHP
source: "$apiInstance = new OpenAPI\\Client\\Api\\TemplateVersionsApi($config, new GuzzleHttp\\Client());\n$template_version_writable = new OpenAPI\\Client\\Model\\TemplateVersionWritable(\n array(\n \"description\" => \"Second Version\",\n \"html\" => \"<html>Second HTML for {{name}}</html>\",\n )\n);\n\ntry {\n $result = $apiInstance->create(\"tmpl_4aa14648113e45b\", $template_version_writable);\n} catch (Exception $e) {\n echo $e->getMessage(), PHP_EOL;\n}\n"
- lang: Java
source: "TemplateVersionsApi apiInstance = new TemplateVersionsApi(config);\n\ntry {\n TemplateVersionWritable = new TemplateVersionWritable();\n .set(\"Second Version\");\n .set(\"<html>Second HTML for {{name}}</html>\");\n\n TemplateVersion result = apiInstance.create();\n} catch (ApiException e) {\n e.printStackTrace();\n}\n"
label: JAVA
- lang: Elixir
source: 'This feature is not currently supported by this library.
'
label: ELIXIR
- lang: CSharp
source: "TemplateVersionsApi api = new TemplateVersionsApi(config);\n\nTemplateVersionWritable templateVersionWritable = new TemplateVersionWritable(\n \"Second Version\", // description\n \"<html>Second HTML for {{name}}</html>\" // html\n);\n\ntry {\n TemplateVersion result = api.create(\"tmpl_4aa14648113e45b\", templateVersionWritable);\n} catch (ApiException e) {\n Console.WriteLine(e.ToString());\n}\n"
label: CSHARP
- lang: Go
source: "var context = context.Background()\ncontext = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv(\"<YOUR_API_KEY>\")})\n\nvar apiClient = *lob.NewAPIClient(configuration)\n\n\nvar templateVersionCreate = *lob.NewTemplateVersionWritable()\ntemplateVersionCreate.SetDescription(\"Second Version\")\ntemplateVersionCreate.SetHtml(\"<html>Second HTML for {{name}}</html>\")\n\n\n\ncreatedtemplateVersion, _, err := apiClient.TemplateVersionsApi.Create(context, \"tmpl_4aa14648113e45b\").TemplateVersionWritable(templateVersionCreate).Execute()\n\nif err != nil {\n return err\n}\n"
label: GO
components:
schemas:
date_created:
type: string
format: date-time
description: A timestamp in ISO 8601 format of the date the resource was created.
template_version_writable:
type: object
required:
- html
properties:
description:
$ref: '#/components/schemas/resource_description'
html:
$ref: '#/components/schemas/template_html'
engine:
$ref: '#/components/schemas/engine'
required_vars:
$ref: '#/components/schemas/template_required_vars'
engine:
type: string
description: "The engine used to combine HTML template with merge variables.\n * `legacy` - Lob's original engine\n * `handlebars`\n"
enum:
- legacy
- handlebars
nullable: true
default: legacy
error:
type: object
description: Lob uses RESTful HTTP response codes to indicate success or failure of an API request. In general, 2xx indicates success, 4xx indicate an input error, and 5xx indicates an error on Lob's end.
required:
- error
properties:
error:
type: object
required:
- message
- status_code
- code
properties:
message:
type: string
description: A human-readable message with more details about the error
example: Rate limit exceeded. Please wait 5 seconds and try your request again.
status_code:
$ref: '#/components/schemas/failure_status_code'
code:
type: string
enum:
- bad_request
- conflict
- feature_limit_reached
- internal_server_error
- invalid
- not_deletable
- not_found
- request_timeout
- service_unavailable
- unrecognized_endpoint
- unsupported_lob_version
- address_length_exceeds_limit
- bank_account_already_verified
- bank_error
- billing_address_required
- custom_envelope_inventory_depleted
- deleted_bank_account
- failed_deliverability_strictness
- file_pages_below_min
- file_pages_exceed_max
- file_size_exceeds_limit
- foreign_return_address
- inconsistent_page_dimensions
- invalid_bank_account
- invalid_bank_account_verification
- invalid_check_international
- invalid_country_covid
- invalid_file
- invalid_file_dimensions
- invalid_file_download_time
- invalid_file_url
- invalid_image_dpi
- invalid_international_feature
- invalid_perforation_return_envelope
- invalid_template_html
- mail_use_type_can_not_be_null
- merge_variable_required
- merge_variable_whitespace
- payment_method_unverified
- pdf_encrypted
- special_characters_restricted
- unembedded_fonts
- email_required
- invalid_api_key
- publishable_key_not_allowed
- rate_limit_exceeded
- unauthorized
- unauthorized_token
description: 'A pre-defined string identifying an error. Error codes fall into three categories:
**GENERIC**
* `bad_request` - 422: an invalid request was made. See error message for details.
* `conflict` - 409/422: this operation would leave data in a conflicted state.
* `feature_limit_reached` - 403: the account has reached its resource limit and requires upgrading to add more.
* `internal_server_error` - 500: an error has occured on Lob''s servers. Please try request again.
* `invalid` - 422: an invalid request was made. See error message for details.
* `not_deletable` - 422: an attempt was made to delete a resource, but the resource cannot be deleted.
* `not_found` - 404: the requested resource was not found.
* `request_timeout` - 408: the request took too long. Please try again.
* `service_unavailable` - 503: the Lob servers are temporarily unavailable. Please try agian.
* `unrecognized_endpoint` - 404: the requested endpoint doesn''t exist.
* `unsupported_lob_version` - 422: an unsupported Lob API version was requested.
**ADVANCED**
* `address_length_exceeds_limit` - 422: the sum of to.address_line1 and to.address_line2 cannot surpass 50 characters.
* `bank_account_already_verified` - 422: the bank account has already been verified.
* `bank_error` - 422: there''s an issue with the bank account.
* `billing_address_required` - 403: in order to create a live mail piece, your account needs to set up a billing address.
* `custom_envelope_inventory_depleted` - 422: custom envelope inventory is depleted, and more will need to be ordered.
* `deleted_bank_account` - 404: checks cannot be created with a deleted bank account.
* `failed_deliverability_strictness` - 422: the `to` address doesn''t meet strictness requirements. See <a href="https://dashboard.lob.com/#/settings/account" target="_blank">Account Settings</a> to configure strictness.
* `file_pages_below_min` - 422: not enough pages.
* `file_pages_exceed_max` - 422: too many pages.
* `file_size_exceeds_limit` - 422: the file size is too large. See description for details.
* `foreign_return_address` - 422: the `from` address must be a US address.
* `inconsistent_page_dimensions` - 422: all pages of the input file must have the same dimensions.
* `invalid_bank_account` - 422: the provided bank routing number is invalid.
* `invalid_bank_account_verification` - 422: verification amounts do not match.
* `invalid_check_international` - 422: checks cannot be sent internationally.
* `invalid_country_covid` - 422: the postal service in the specified country is currently unable to process the request due to COVID-19 restrictions.
* `invalid_file` - 422: the file is invalid.
* `invalid_file_dimensions` - 422: file dimensions are incorrect for the selected mail type.
* `invalid_file_download_time` - 422: file download from remote server took too long.
* `invalid_file_url` - 422: the file URL when creating a resource is invalid.
* `invalid_image_dpi` - 422: DPI must be at least 300.
* `invalid_international_feature` - 422: the specified product cannot be sent to the destination.
* `invalid_perforation_return_envelope` - 422: both `return_envelope` and `perforation` must be used together.
* `invalid_template_html` - 422: the provided HTML is invalid.
* `mail_use_type_can_not_be_null` - 422: use_type must be one of "marketing" or "operational". Alternatively, an admin can set the account default use type in Account Settings.
* `merge_variable_required` - 422: a required merge variable is missing.
* `merge_variable_whitespace` - 422: merge variable names cannot contain whitespace.
* `payment_method_unverified` - 401: you must have a verified bank account or credit card to submit live requests.
* `pdf_encrypted` - 422: an encrypted PDF was provided.
* `special_characters_restricted` - 422: cannot use special characters for merge variable names.
* `unembedded_fonts` - 422: the provided PDF contains non-standard unembedded fonts. See description for details.
**AUTHENTICATION**
* `email_required` - 401: account must have a verified email address before creating live resources.
* `invalid_api_key` - 401/403: the API key is invalid.
* `publishable_key_not_allowed` - 403: the requested operation needs a secret key, not a publishable key. See [API Keys](#section/API-Keys) for more information.
* `rate_limit_exceeded` - 429: requests were sent too quickly and must be slowed down.
* `unauthorized` - 401: the request isn''t authorized.
* `unauthorized_token` - 401: token isn''t authorized.
'
template_version:
allOf:
- $ref: '#/components/schemas/template_version_writable'
- $ref: '#/components/schemas/lob_base'
- type: object
required:
- id
properties:
id:
$ref: '#/components/schemas/vrsn_id'
suggest_json_editor:
type: boolean
description: 'Used by frontend, true if the template uses advanced features.
'
merge_variables:
type: object
description: 'Object representing the keys of every merge variable present in the template. It has one key named ''keys'', and its value is an array of strings.
'
object:
type: string
description: Value is resource type.
enum:
- version
default: version
count:
type: integer
description: number of resources in a set
template_version_updatable:
type: object
properties:
description:
$ref: '#/components/schemas/resource_description'
engine:
$ref: '#/components/schemas/engine'
required_vars:
$ref: '#/components/schemas/template_required_vars'
tmpl_id:
type: string
description: Unique identifier prefixed with `tmpl_`. ID of a saved [HTML template](#section/HTML-Templates).
pattern: ^tmpl_[a-zA-Z0-9]+$
template_version_deletion:
description: Lob uses RESTful HTTP response codes to indicate success or failure of an API request. In general, 2xx indicates success, 4xx indicate an input error, and 5xx indicates an error on Lob's end.
properties:
id:
$ref: '#/components/schemas/vrsn_id'
deleted:
$ref: '#/components/schemas/deleted'
date_filter:
type: object
additionalProperties:
type: string
description: 'Filter by ISO-8601 date or datetime, e.g. `{ "gt": "2012-01-01", "lt": "2012-01-31T12:34:56Z" }` where `gt` is >, `lt` is <, `gte` is e, and `lte` is d.'
vrsn_id:
type: string
description: Unique identifier prefixed with `vrsn_`.
pattern: ^vrsn_[a-zA-Z0-9]+$
resource_description:
type: string
description: 'An internal description that identifies this resource. Must be no longer than 255 characters.
'
maxLength: 255
nullable: true
deleted:
type: boolean
description: Only returned if the resource has been successfully deleted.
template_required_vars:
type: array
items:
type: string
description: 'An array of required variables to be used in a template. Only available for `handlebars` templates.
'
lob_base:
type: object
required:
- date_created
- date_modified
- object
properties:
date_created:
$ref: '#/components/schemas/date_created'
date_modified:
$ref: '#/components/schemas/date_modified'
deleted:
$ref: '#/components/schemas/deleted'
object:
$ref: '#/components/schemas/object'
failure_status_code:
type: integer
enum:
- 401
- 403
- 404
- 413
- 422
- 429
- 500
# --- truncated at 32 KB (40 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/lob/refs/heads/main/openapi/lob-versions-api-openapi.yml