REST API - setting a job stream in draft

Use REST APIs to change the status of a job stream to draft.

About this task

This process involves retrieving the job stream current data through a GET REST API and then submitting an updated version through a POST REST API.

Procedure

  1. First, you need to get the unique ID and the current configuration (payload) of the job stream you want to modify. Use the GET/twsd//api/v2/model/jobstream endpoint to find the job stream.
    1. In the Swagger UI, expand the endpoint, select Filter by exact name and matching folder and sort results in name descending order in the oql string parameter field, enter the name of the job stream in the name field, and click Execute.
    2. From the API response, copy and save the following two items: the job stream ID in the response header and the entire JSON payload from the response body. Example of a response payload:
      {
       "count": 1,
       "results": [
         {
           "kind": "JobStream",
           "key": "/WA_FTA_XA#/FINAL",
           "def": {
             "id": "9254f5da-181a-3be8-a1f1-8c978848c261",
             "abstractId": "61918471-ce1b-3d21-bb66-6dd4d9e3a5ba",
             "folderId": "742ba6a6-31aa-3051-b810-3ced4fc624b4",
             "folder": "/",
             "name": "FINAL",
             "workstationId": "9819daa5-1a2a-385b-b238-cfa7309c65d2",
             "workstation": "/WA_FTA_XA",
      
      ...
      }
  2. Now, use the information you just retrieved to send an update request. Use the PUT/twsd/api/v2/model/jobstream/{jobStream_id} endpoint to update the job stream.
    1. In the Swagger UI, expand the endpoint and paste the Job Stream ID you copied in the previous step in the ID parameter field.
    2. In the Request body field, paste the entire JSON payload you copied.
    3. In the JSON you just pasted, find the options parameter and include the draft parameter in the options list:
      ...
        
      "validTo": "2025-09-23T09:44:10.278Z",
          "timeZone": "string",
          "description": "This is a test job stream.",
          "documentation": "string",
          "options": [
            "draft"
          ],
      ...
      
    4. Click Execute. The API returns a success message, and your job stream is now in draft mode.
  3. To confirm the job stream is now in draft mode, run the GET/twsd//api/v2/model/jobstream API call again and check that the draft value is present in the option list.