--- title: "Using API to Publish Content" slug: "using-api-to-publish-content" updated: 2024-07-12T09:32:52Z published: 2024-07-12T09:32:52Z 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 ## Introduction The ViewLift CMS (VLCMS) Upload API allows you to programmatically upload and manage video content on the ViewLift platform. This guide provides detailed instructions on how to use the API, including required parameters, field descriptions, and example requests. The API enables you to streamline your content management workflow, ensuring efficient and automated video uploads with optional encoding, DRM settings, and metadata management. ## Purpose The purpose of the VLCMS Upload API is to facilitate the efficient and automated uploading of video content to the ViewLift platform. By using this API, you can: - Upload video files directly to the ViewLift CMS. - Automatically encode videos and manage DRM settings. - Attach metadata, images, and additional assets to your videos. - Schedule video publishing and visibility settings. - Integrate video content management into your existing workflow and applications. ## Prerequisites Before using the VLCMS Upload API, ensure you have met the following prerequisites: 1. **API Key**: Obtain an API Key from the ViewLift CMS under **Admin** > **SDK Management**. You can generate up to 5 API Keys for your account. 2. **ViewLift S3 Bucket Access**: Ensure your source files are located in your dedicated ViewLift S3 bucket. Contact your account manager to set up access for sending assets to this bucket. 3. **CURL Tool**: Have the CURL command-line tool installed for making HTTP requests (alternatively, you can use any other HTTP client). 4. **Metadata Information**: Prepare all necessary metadata, including title, description, author details, and image URLs, to include in your upload requests. 5. **Video File**: Ensure your video file is correctly formatted and uploaded to the ViewLift S3 bucket. ## Upload Request (with Encoding) Follow these date formats when specifying `airDateTime` and `seasonAirDateTime`: - `airDateTime`: "*2023-10-22T23:00:00.000 PM*” - `seasonAirDateTime`: "*07/26/2019 7:30 AM*" Include these keys in your JSON payload: - `drmEnabled`: Boolean indicating if DRM is enabled. - `externalId`: Unique identifier for assets migrated or created via the API. ### Requirements - When sending `sourceKey (s3Url)`, do not send `videoAssets`, and vice versa. - Always include `videoImageUrl` when using this API. - EDL and CC files will only function when the`sourceKey (s3Url)` is included in the API; they will not work if `videoAssets` are sent in the API. ### Recommendations - If `posterImageUrl` is unavailable, ignore it rather than passing null. - For schedule times not required up to year 2080, omit `scheduleStartTime`, `scheduleEndTime`, `scheduleStartDate`, `scheduleEndDate`. - When declaring schedule start and end times, include timezone. - If categories, tags, or closed captions aren't available, pass an empty array. ### Sample JSON ```plaintext {    "site": "abc-tv",    "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",    "s3Url": "s3://boost-abc-tv/MezzFiles/archive/2023/10/TV show name-2023-10-22T18-00.mp4",    "edlUrl": "s3://boost-abc-tv/Edl/2024/07/10/1720583818875_adlc240529_mod1.edl",    "ccUrl": "s3://boost-abc-tv/Captions/2024/07/10/1720583826286_sample_webvtt.vtt",    "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) For uploading content with pre-existing renditions, use the following format: API Endpoint: [https://tools.viewlift.com/v2.0/content/video](https://tools.viewlift.com/v2.0/content/video) Method: POST Headers: **xApiKey Body**: ```plaintext {    "site": "",    "author": "",    "description": "",    "drmEnabled": false,    "email": "",    "status": "open",    "filename": "",    "isLiveStream": false,    "free": false,    "fileSize": 26,    "videoImageUrl": "https://cdn.com/asset.jpg",    "posterImageUrl": "https://cdn.com/asset.jpg",    "title": "