--- title: "Using API to Publish Content" slug: "using-api-to-publish-content" updated: 2024-06-24T16:18:53Z published: 2024-06-24T16:18:53Z canonical: "docs.viewlift.com/using-api-to-publish-content" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.viewlift.com/llms.txt > Use this file to discover all available pages before exploring further. # Using API to Publish Content ## **VLCMS Upload API** You can upload content to the ViewLift CMS via an API. To upload to the ViewLift CMS, an API Key is needed, which is generated in the ViewLift CMS after logging into your account. Once you upload content to the CMS, the API will respond with an ID for that asset, and you will be able to get details of that asset from the CMS or the List API. #### ViewLift API Key To request a ViewLift Token, you’ll need a ViewLift API Key. You can generate up to 5 API Keys for your account in the CMS by going to Admin -> SDK Management: ![image.png](https://cdn.document360.io/15e0c142-c823-4c77-a8e8-9d32ca937982/Images/Documentation/image%2885%29.png) #### Uploading (with Encoding) Prerequisite If you wish to upload the original source file, and have the ViewLift encoding system process the file to create the encoded renditions of the video asset, as a prerequisite, the content you wish to upload must be already located in your dedicated ViewLift S3 bucket. That location is then used to pull the asset, put it through the encoding process, and create the object with the metadata and renditions in the ViewLift Platform and CMS. This is the most typical use case for VOD content. You can contact your account manager to set up access for you to send assets to your dedicated ViewLift S3 bucket. **Upload Request (with Encoding)** Follow these date formats - airDateTime:" 2023-10-22T23:00:00.000 PM” - seasonAirDateTime: "07/26/2019 7:30 AM" When you need the ViewLift Platform to encode the asset from the Mezz file, only some metadata and information is required. You can get the value for the “site” key from your account manager. Keys I've added: drmEnabled, externalId, siteOwner, videoResolution - drmEnabled is a boolean - externalId is a string used for referencing internally assets that are migrated or created via uploadandpublish api; Please keep these values unique to each asset - siteOwner is a string, just make this the same as site​​​​ - videoResolution is a string that either either "SD" or "HD" **Requirement**: - If you are sending the sourceKey you do not need to send videoAssets ; this applies vice versa. - Always send the videoImageUrl as you have above when using this api. ​ **Recommendations**: - If you do not have a posterImageUrl you can ignore it rather than passing null - I see you are passing the scheduled times that goes to year 2080, you don't have to pass it if you don't require scheduleStartTime, scheduleEndTime, scheduleStartDate, scheduleEndDate. - If you are declaring the schedule start and end times, pass the timezone also - If you do have any categories, tags, closedCaptions to send, you can ignore it rather than passing an empty array. Sample JSON: ``` { "site": "abc-tv", "siteOwner": "abctv", "title": "The TV Show'\''s TV Show", "description": "ABC'\''s Insights: The TV Show", "drmEnabled": false, "status": "open", "fileName": "TVshowname-2023-10-22T18-00.mp4", "sourceKey": "s3://boost-abc-tv/MezzFiles/archive/2023/10/TV show name-2023-10-22T18-00.mp4", "author": "BEK", "email": "xyzabc@gmail.com", "videoImageUrl": "http://v-abc-tv.viewlift.com/MezzFiles/images/2023/10/TV show name-2023-10-22T18-00.png", "airDateTime": "2023-10-22T23:00:00.000", "seasonAirDateTime": "8/8/2019 5:00 AM", "airTimezone": "US/Eastern", "seasonAirTimezone": "US/Eastern", "year": 2019, "thirdParty": "abc-tv", "objectKey": "video", "isTrailer": false, "isLiveStream": false, "free": false, "licenses": [], "scheduleEndDate": "1/1/2080", "scheduleEndTime": "12:00 PM", "scheduleStartDate": "8/8/2019", "scheduleStartTime": "12:00 AM", "timezone": "US/Eastern", "externalId": "3bc82664-0eda-4442-a8b6-682c36349254" } ``` Upload Request (without Encoding) When you already have the renditions created and want to set those renditions, not needing to go through the encoding process, you can use the following format below. ![image.png](https://cdn.document360.io/15e0c142-c823-4c77-a8e8-9d32ca937982/Images/Documentation/image%2886%29.png) API: ​https://tools.viewlift.com/vlcms/video/uploadAndPublish Method: ​POST ​Headers: ​xApiKey ​Body: ``` { "site":"", "author":"", "description":"", "status":"open", "filename":"", "isLiveStream":false, "free":false, "fileSize":26, "videoImageUrl":"https://cdn.com/asset.jpg";, "posterImageUrl":"https://cdn.com/asset.jpg";, "title":"