Upsert a language variant
Add content to a language variant in an active language or update an existing language variant. You cannot update an existing language variant if its workflow step is set to Archived, Published, or Scheduled.
When creating a new variant:
- The content item for the variant must already exist. The item isn't created automatically on variant upsert.
- Non-localizable elements are filtered out for variants in non-default languages.
When updating an existing variant, only the elements specified in the request body will be modified.
When copying variants, you can take the variant object returned by a GET request and use it as-is in the body of this request. If you need to migrate variants to another environment or project, see how to import content items.
Request Body
{"elements"=>[{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, {"value"=>"<Error: Too many levels of nesting to fake this schema>"}], "workflow"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, "workflow_step"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, "item"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, "language"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, "last_modified"=>"<dateTime>", "schedule"=>{"publish_time"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, "publish_display_timezone"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, "unpublish_time"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, "unpublish_display_timezone"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}}, "due_date"=>{"value"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}}}
HEADERS
| Key | Datatype | Required | Description |
|---|---|---|---|
Content-Type | string | ||
Accept | string |
RESPONSES
status: Created
{"elements":[{"element":{"id":"108ed7c0-fc8c-c0ec-d0b5-5a8071408b54"},"value":[{"id":"117cdfae-52cf-4885-b271-66aef6825612"}]},{"element":{"id":"f2ff5e3f-a9ca-4604-58b0-34a2ad6a7cf1"},"mode":"autogenerated","value":"my-articles-title"},{"element":{"id":"63793ba4-6004-a93c-68ca-52a1f0482bca"},"value":[{"id":"f6daed1f-3f3b-4036-a9c7-9519359b9601"},{"id":"a6daed1f-4f3b-4037-a9c1-9537359b9600"}]},{"element":{"id":"68f65095-c9b4-05d6-a473-2883c2f0c7af"},"value":"A tiny little plaintext."}],"due_date":{"value":"2024-02-26T08:00:00"},"schedule":{"publish_time":"2024-03-31T08:00:00","publish_display_timezone":"Europe/Prague","unpublish_time":"2024-04-30T08:00:00","unpublish_display_timezone":"Europe/Prague"},"workflow":{"workflow_identifier":{"id":"06ea628e-4ec7-4991-91e4-1412995151ee"},"step_identifier":{"id":"dc87d7cf-424b-4b89-9519-c9f79a3458b7"}},"workflow_step":{"id":"dc87d7cf-424b-4b89-9519-c9f79a3458b7"},"item":{"id":"f4b3fc05-e988-4dae-9ac1-a94aba566474"},"language":{"id":"d1f95fde-af02-b3b5-bd9e-f232311ccab8"},"last_modified":"2020-11-21T09:08:33.2229841Z"}