{
  "openapi" : "3.0.1",
  "info" : {
    "title" : "Irdeto DWM FE API",
    "description" : "## General\nThe following REST APIs facilitate video content pre-processing in the Irdeto Distributor Watermarking system, providing the Irdeto forensic watermark embedding service to the high-quality media content owners or content management systems. For a general introduction to the Irdeto DWM service refer to [https://help.dwm.irdeto.io](https://help.dwm.irdeto.io).\n## Storage access configuration\nBefore start using Irdeto APIs listed in this reference (particularly `/v3/jobs` and `/v3/transfers` APIs), content owner should proceed with the configuration of corresponding cloud infractructure setup in order to allow Irdeto services the necessary level of access to the original content storage. In case of AWS, this relates to AWS IAM configuration via AWS Management console. In case of GCP, this relates to GCP bucket-level IAM configuration via Google Cloud Console. This is typically a once-off effort done in cooperation between content owner and Irdeto support engineer who is assisting initial integration with DWM service.\n## API usage concepts\nContent owner uses DWM service through the means of DWM API calls, integrating thus Irdeto watermarking capability into content owner's business workflows. Among the workflows of customer's business processes, there will be few defined areas which relate to the use of Irdeto DWM APIs: **identities management**, **watermark pre-processing**, **watermark post-processing**.\n### Identities management\nIrdeto does not store any recipient's privacy infringing information for whom the watermarked files are destined within content owner's business workflows. Instead, DWM defines the term of 'identity', which is the abstract reference identifier that the caller must associate with the content recipient. In this page, such reference identifier is generally mentioned as `<identityId>`, and its value is generated and provided by DWM API in the response to particular API endpoint (`/v3/identities`) call specified under \"Identities\" section of the reference below. The returned value is the positive integer as specified by same reference section. The recommended use of `<identityId>` is to map this identifier value to the user ID of the recipient in content owner's CMS and therefore use this identifier's value for all the files delivered with Irdeto watermark to that recipient. In the pseudo-markup, such a mapping may look like (assuming that the email represents user ID in CMS): <p><code> { \"john.smith@company.com\": 1238476105, \"delivery.end@ottservice.com\": 7729541523 } </code></p> and is meant to provide the ability to do direct as well as reverse lookups by customer's user ID (email in the example above) and Irdeto Identity ID respectively. New Irdeto identities may be generated on-demand before, during or after pre-processing, but always prior to transferring a file with Irdeto watermark to the associated destination recipient. Note: it is up to content owner, how the storage and persisting of the above mentioned mapping is implemented and integrated into owner's CMS. Irdeto doesn't prescribe any technical guidelines or examples on how to achieve that, except of above recommendation with regards to semantics.\n\n### Watermark Pre-processing (a.k.a ‘watermark embedding’)\nDuring this phase the original media file is being analyzed and a variant file containing the binary differences for watermarked video frames is created. Such pre-processing is consuming signinficant amount of time to complete. The original file is not modified in any way. The variant file is about 3% of the size of the original content and cannot be played as video stream independently. The pre-processing workflow is achieved by using `/v3/jobs` APIs listed under \"Jobs\" of this reference. The pre-processing is triggered by calling `POST /v3/jobs` API request, that will create watermark embedding job in the DWM service. The job \"id\" value is contained within response, and is meant to be used as the required parameter for other `/v3/jobs` API requests. Watermark embedding job has the semantic of the task processing, which in essense it is. Further, watermark job data contains such properties like \"status\" and \"progress\" percentage, where important one is the status that is expected to take value of \"COMPLETE\" or \"ERROR\" when DWM service finishes pre-processing of the content for the job. The created variant file is not exposed externally, and is used internally in both pre-processing (when its data is produced) and post-processing (when its data is consumed) flows.\n### Watermark Post-processing (a.k.a. ‘watermark switching’)\nDuring this phase the final individually watermarked version of the media file is created. Currently, post-processing is possible to happen in one of following configurations: * content owner's CMS is integrated with Aspera On Cloud solution by IBM, where Aspera system components are providing interfacing points to transfer content with Irdeto watermark; * content owner's CMS implements the usage of the DWM Transfers-In-Cloud feature, where DWM processing components are used to perform content transfer with Irdeto watermark\nThe latter option can only work for the transfers with destinations to the same cloud storage type, e.g. from one AWS bucket to another. In that case, CMS can make use of the relevant APIs defined under \"Transfers\" section of this API specification. Semantically, each transfer must reference the earlier obtained `<identityId>` and `<jobId>` values.\n\n## Definitions\n<hr><b>Job</b> is an API resoure that represents processing of single media content. Job is identified by \"jobId\". <hr><b>Identity</b> is Irdeto personalization identity resource, that has its unique identifier. DWM holds the special personalization payload for each identity, that is used by DWM sytem privately in order to facilitate personalized media content creation during the post-processing phase.\n\n### JSON Fields\n***\n**jobId** job unique identifier, integer value. It should be used by all the actors that consume this APIs.\n***\n**inFile** is an absolute URI of the media content to be watermarked. Examples: <i>file:///mnt/data/my-files/movie.mov</i>, <i>s3://bucket-data/streams/my-movie.mp4</i>\n***\n**status** represents job completion status, see below API specification for values. Job is in `PENDING` state after creation before any processing takes place. Job is in `IN_PROGRESS` while media content is processed by Irdeto DWM system. Job is `COMPLETE` when all processing done succesfully and submitted media file is ready to the futher distributions by owner. In case of unrecoverable errors during the job processing, the status is set to `ERROR`, with attached additional error info (code, message).\n***\n\n### Authorization\n**Authorization** header must be present in every request to DWM API(s) as demanded by below specifications. The value must have \"Bearer\" scheme and contain JWT access token.\n\n## Workflows and use-cases\n\n### API workflow sequence for pre-processing with DWM and post-processing using third-party integrated transfer service\nIn this use-case the creation of the individually watermarked files is done on-the-fly during the transfer of the media file. This can be done by any third-party transfer provider that has integrated the Irdeto Switcher API library, for example IBM with their Aspera-on-Cloud solution. IBM Aspera take care of integration on the level of Irdeto DWM APIs. Customers can in turn make use of the AoC GUI or use the IBM AoC APIs to trigger Package transfers with watermarked files.\n<br>![foo](dwm-api-sequence-default.svg \"Default workflow\")\n\n### API workflow sequence for both pre-processing and post-procesing with DWM using DWM Transfers-In-Cloud\nIn this use-case the creation of the individually watermarked files is done as a ‘transfer’ from originals cloud storage to destination ‘cloud-local’ storage location. This use of the Irdeto SaaS solution does not require integration with a Transfer service provider such as IBM Aspera and gives the content owner full control over the resulting watermarked files, for instance to perform further modifications prior to file transmission to the recipient or use alternative transfer methods. The workflow user is responsible for correct pre-processing of the original files and ensuring the the final transfers are initiated with the Irdeto `<identityId>` values of the relevant files recipients. This solution requires that Irdeto's DWM SaaS components have read-only access to the original input file cloud storage objects (identical in all use cases) and read/write access to the cloud storage location of the output switched/individualized files.\nNote: in the below diagram \"once-off pre-configuration\" sections are only for the demonstration purposes, and are not making the part of the actual API integration.\n<br>![foo](dwm-api-sequence-transfers.svg \"Workflow with transfers\")\n\n### API workflow with checksums (SHA1) calculation\nThis workflow can be used to pre-create verification checksums for the in-future-downloaded files with Irdeto watermark. This workflow can find its adaptation for IMF distribution processes. Creation of the individually watermarked files in an IMF package may have additional requirements around updating the file SHA-1 hash value and UUIDs used in the file header and filename. The preferred transfer solution is with the switcher library integrated with a transfer provider, like IBM Aspera on Cloud, so that watermarks can be inserted at download time without the need for duplication of the content. IMF files are usually in the Terabyte size range making duplication undesired from a cost, storage and time perspective. The DWM SaaS offers an additional preparation steps after the watermarking job/embedding task to pre-calculate the hash of the video file as it would be received by a user (so with frames replaced by watermarked frames). At actual download a recipient will receive exactly the binary download corresponding to the pre-calculated hash. This hash calculation has to be performed per each intended identity for watermarked content delivery, so that the corresponding composition playlist and other files can be updated by CMS controllers.\n\n<br>![foo](dwm-api-sequence-with-hashing.svg \"Workflow with SHA1 hash computation\")",
    "termsOfService" : "https://irdeto.com/support.html",
    "contact" : {
      "email" : "communications@irdeto.com"
    },
    "license" : {
      "name" : "Irdeto Proprietary License",
      "url" : "https://irdeto.com"
    },
    "version" : "3.0"
  },
  "servers" : [ {
    "url" : "/",
    "description" : "Current DWM service instance"
  } ],
  "paths" : {
    "/v3/status" : {
      "get" : {
        "tags" : [ "General" ],
        "summary" : "Status of the service",
        "description" : "Get service status overview, including database connection status, and counts for the jobs pending/in progress now, and for the jobs completed/failed during last 24h",
        "operationId" : "getStatus",
        "responses" : {
          "200" : {
            "description" : "DWM status object",
            "content" : {
              "application/json; charset=UTF-8" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Status"
                }
              }
            }
          },
          "503" : {
            "description" : "DWM status not healthy",
            "content" : {
              "application/json; charset=UTF-8" : {
                "schema" : {
                  "type" : "string",
                  "example" : {
                    "dbConnection" : "ERROR",
                    "error" : {
                      "code" : 3002,
                      "message" : "Database connection lost"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v3/version" : {
      "get" : {
        "tags" : [ "General" ],
        "summary" : "Obtain service version",
        "description" : "Obtain service version",
        "operationId" : "getVersion",
        "responses" : {
          "200" : {
            "description" : "Returns version of the system",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Version"
                }
              }
            }
          }
        }
      }
    },
    "/v3/jobs" : {
      "get" : {
        "tags" : [ "Jobs" ],
        "summary" : "Lists the watermarking jobs",
        "description" : "Search watermarking jobs using period (days), status or both",
        "operationId" : "apiGetJobs",
        "parameters" : [ {
          "name" : "status",
          "in" : "query",
          "description" : "Filtering parameter: All watermark job matching \"status\" are included in the response payload.",
          "schema" : {
            "type" : "string",
            "enum" : [ "PENDING", "IN_PROGRESS", "COMPLETE", "ERROR" ]
          }
        }, {
          "name" : "period",
          "in" : "query",
          "description" : "Filtering parameter: All jobs whch have a submission time covered by the number of days supplied are included in the response payload.",
          "schema" : {
            "minimum" : 0,
            "type" : "integer",
            "format" : "int32"
          }
        }, {
          "name" : "page",
          "in" : "query",
          "description" : "The page number of items in 0-base supplied  sorted starting with the newest items first.",
          "schema" : {
            "minimum" : 0,
            "type" : "integer",
            "format" : "int32",
            "default" : 0
          }
        }, {
          "name" : "pageSize",
          "in" : "query",
          "description" : "The number of items included on a single page",
          "schema" : {
            "minimum" : 0,
            "type" : "integer",
            "format" : "int32",
            "default" : 100
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "Watermark jobs result",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/WatermarkJobDataList"
                }
              }
            }
          },
          "400" : {
            "description" : "Invalid value supplied for any of specified query string parameters (status, period, page, pageSize)",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Error"
                }
              }
            }
          },
          "401" : {
            "description" : "Unauthorized access attempted (e.g. no tenant ID header provided)",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security" : [ {
          "BearerAuth" : [ ]
        } ]
      },
      "post" : {
        "tags" : [ "Jobs" ],
        "summary" : "Submit a watermarking job",
        "description" : "Create a watermarking job",
        "operationId" : "apiSubmitJob",
        "parameters" : [ ],
        "requestBody" : {
          "content" : {
            "application/json; charset=UTF-8" : {
              "schema" : {
                "type" : "string",
                "example" : {
                  "inFile" : "s3://storagebucket/path/to-the-object/file.mp4"
                }
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "201" : {
            "description" : "A watermarking job is successfully submitted",
            "headers" : {
              "Location" : {
                "description" : "Absolute URI to newly created job",
                "required" : true,
                "style" : "simple"
              }
            }
          },
          "400" : {
            "description" : "Invalid 'request' object supplied"
          },
          "401" : {
            "description" : "Unauthorized API access attempted (e.g. no tenant ID header provided, unregistered tenant ID provided)",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security" : [ {
          "BearerAuth" : [ ]
        } ]
      }
    },
    "/v3/jobs/{job_id}" : {
      "get" : {
        "tags" : [ "Jobs" ],
        "summary" : "Get a watermarking job by entering its 'job_id'",
        "description" : "Returns the job",
        "operationId" : "apiGetJob",
        "parameters" : [ {
          "name" : "job_id",
          "in" : "path",
          "description" : "Watermark job ID as known by system",
          "required" : true,
          "schema" : {
            "minimum" : 1,
            "type" : "integer",
            "format" : "int64"
          }
        }, {
          "name" : "X-Ir-Response-Style",
          "in" : "header",
          "schema" : {
            "type" : "string",
            "enum" : [ "BASIC", "COMPLETE" ]
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "Watermark job object",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/WatermarkJobData"
                }
              }
            }
          },
          "404" : {
            "description" : "'job_id' value does not match a job",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Error"
                }
              }
            }
          },
          "400" : {
            "description" : "Invalid 'job_id'. Not a valid type or <0, etc.",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Error"
                }
              }
            }
          },
          "401" : {
            "description" : "Unauthorized access attempted of the specified job with 'job_id' (e.g. no tenant ID header provided)",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Error"
                }
              }
            }
          },
          "403" : {
            "description" : "Access of the specified job with 'job_id' is forbidden (e.g. resource owned by other tenant)",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security" : [ {
          "BearerAuth" : [ ]
        } ]
      },
      "delete" : {
        "tags" : [ "Jobs" ],
        "summary" : "Delete a watermark job with a given id",
        "description" : "Delete a job with a certain id",
        "operationId" : "apiDeleteJob",
        "parameters" : [ {
          "name" : "job_id",
          "in" : "path",
          "description" : "Watermark job ID as known by system",
          "required" : true,
          "schema" : {
            "minimum" : 1,
            "type" : "integer",
            "format" : "int64"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "When watermark job has been successfully deleted"
          },
          "400" : {
            "description" : "Invalid 'job_id' value supplied, e.g. not valid type, <0, etc."
          },
          "404" : {
            "description" : "When watemark job is not found by id 'job_id'"
          },
          "409" : {
            "description" : "When there currently active transfers associated with watermark job with id 'job_id'"
          },
          "401" : {
            "description" : "Unauthorized access attempted of the specified job with 'job_id' (e.g. no tenant ID header provided)",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Error"
                }
              }
            }
          },
          "403" : {
            "description" : "Access of the specified job with 'job_id' is forbidden (e.g. resource owned by other tenant)",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security" : [ {
          "BearerAuth" : [ ]
        } ]
      }
    },
    "/v3/identity" : {
      "post" : {
        "tags" : [ "Identity" ],
        "summary" : "Create new identity",
        "description" : "Create a new identity",
        "operationId" : "apiCreateIdentity",
        "parameters" : [ ],
        "responses" : {
          "201" : {
            "description" : "When identity has been successfully created; location is supplied in the response",
            "headers" : {
              "Location" : {
                "required" : true,
                "style" : "simple"
              }
            }
          }
        },
        "security" : [ {
          "BearerAuth" : [ ]
        } ]
      }
    },
    "/v3/transfers/{transfer_id}" : {
      "get" : {
        "tags" : [ "Transfers" ],
        "summary" : "Obtain transfer by a supplied id",
        "description" : "Returns a transfer object",
        "operationId" : "apiGetTransfer",
        "parameters" : [ {
          "name" : "transfer_id",
          "in" : "path",
          "description" : "Transfer ID value",
          "required" : true,
          "schema" : {
            "minimum" : 1,
            "type" : "integer",
            "format" : "int64"
          }
        }, {
          "name" : "transfer_id",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "integer",
            "format" : "int64"
          }
        }, {
          "name" : "X-Ir-Dwm-Expand-SubResource",
          "in" : "header",
          "schema" : {
            "type" : "boolean",
            "default" : false
          }
        } ],
        "responses" : {
          "default" : {
            "description" : "transfer data",
            "content" : {
              "application/json; charset=UTF-8" : {
                "schema" : {
                  "$ref" : "#/components/schemas/TransferData"
                }
              }
            }
          },
          "400" : {
            "description" : "Invalid 'transfer_id' value supplied, e.g. not valid type, <0, etc."
          },
          "404" : {
            "description" : "When transfer is not found by provided 'transfer_id' value"
          }
        },
        "security" : [ {
          "BearerAuth" : [ ]
        } ]
      },
      "delete" : {
        "tags" : [ "Transfers" ],
        "summary" : "Delete the transfer with a given 'transfer_id'",
        "description" : "Delete a transfer for a specified 'transfer_id'",
        "operationId" : "apiDeleteTransfer",
        "parameters" : [ {
          "name" : "transfer_id",
          "in" : "path",
          "description" : "Transfer ID value",
          "required" : true,
          "schema" : {
            "minimum" : 1,
            "type" : "integer",
            "format" : "int64"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "When transfer has been successfully deleted"
          },
          "400" : {
            "description" : "Invalid 'transfer_id' value supplied, e.g. not valid type, <0, etc.",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Error"
                }
              }
            }
          },
          "404" : {
            "description" : "When transfer is not found by id 'transfer_id'",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Error"
                }
              }
            }
          },
          "409" : {
            "description" : "When the transfer by 'transfer_id' is not completed",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security" : [ {
          "BearerAuth" : [ ]
        } ]
      }
    },
    "/v3/transfers" : {
      "get" : {
        "tags" : [ "Transfers" ],
        "summary" : "Get the list of transfers",
        "description" : "Transfers list is returned in the response, based on the values of optional query arguments for 'status', 'job_id' and 'identity_id'. The resulting data set is limited by the values of queryr arguments 'page' and 'pageSize'",
        "operationId" : "apiGetTransfers",
        "parameters" : [ {
          "name" : "job_id",
          "in" : "query",
          "description" : "Filter on: job ID value to get only transfers associated with that job",
          "schema" : {
            "minimum" : 1,
            "type" : "integer",
            "format" : "int64"
          }
        }, {
          "name" : "identity_id",
          "in" : "query",
          "description" : "Filter on: identity ID value to get only transfers created for that identity",
          "schema" : {
            "minimum" : 0,
            "type" : "integer",
            "format" : "int64"
          }
        }, {
          "name" : "status",
          "in" : "query",
          "description" : "Filter on: transfer with given 'status' value will be included in the response list",
          "schema" : {
            "type" : "string",
            "enum" : [ "PENDING", "IN_PROGRESS", "COMPLETE", "ERROR" ]
          }
        }, {
          "name" : "page",
          "in" : "query",
          "description" : "The page number in 0-base of paged result set items, sorted starting with the newest first.",
          "schema" : {
            "minimum" : 0,
            "type" : "integer",
            "format" : "int32",
            "default" : 0
          }
        }, {
          "name" : "pageSize",
          "in" : "query",
          "description" : "The number of items in paged result set",
          "schema" : {
            "minimum" : 0,
            "type" : "integer",
            "format" : "int32",
            "default" : 100
          }
        }, {
          "name" : "originalUriContains",
          "in" : "query",
          "schema" : {
            "type" : "string"
          }
        }, {
          "name" : "X-Ir-Dwm-Expand-SubResource",
          "in" : "header",
          "schema" : {
            "type" : "boolean",
            "default" : false
          }
        } ],
        "responses" : {
          "default" : {
            "description" : "transfer result",
            "content" : {
              "application/json; charset=UTF-8" : {
                "schema" : {
                  "type" : "array",
                  "items" : {
                    "$ref" : "#/components/schemas/TransferData"
                  }
                }
              }
            }
          },
          "400" : {
            "description" : "Invalid 'transfer_id' value supplied, e.g. not valid type, <0, etc."
          },
          "404" : {
            "description" : "When transfer is not found by provided 'transfer_id' value"
          }
        },
        "security" : [ {
          "BearerAuth" : [ ]
        } ]
      },
      "post" : {
        "tags" : [ "Transfers" ],
        "summary" : "Submit new transfer",
        "description" : "Create a new transfer",
        "operationId" : "apiSubmitTransfer",
        "parameters" : [ ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/TransferRequest"
              },
              "examples" : {
                "DWM-operated transfer, with destination" : {
                  "summary" : "Example of the payload for the DWM-operated transfer, where the watermarked file is uploaded to given destination URI by DWM itself",
                  "description" : "DWM-operated transfer, with destination",
                  "value" : {
                    "jobId" : 53,
                    "identityId" : 34587093487923867,
                    "destination" : "s3://sendbucket/path/to-destination/file.mp4"
                  }
                },
                "Caller-operated transfer, without destination" : {
                  "summary" : "Example of the payload for the calling client-operated transfer, where client itself is responsible for all IO and thus storing watermarked data to the target destination as well.",
                  "description" : "Example of the payload for the calling client-operated transfer",
                  "value" : {
                    "jobId" : 141,
                    "identityId" : 84963293487923867
                  }
                }
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "201" : {
            "description" : "When transfer has been successfully submitted",
            "headers" : {
              "Location" : {
                "required" : true,
                "style" : "simple"
              }
            }
          },
          "400" : {
            "description" : "Invalid 'request' object supplied",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Error"
                }
              }
            }
          },
          "404" : {
            "description" : "Request references non-existing resources, e.g. job, identity",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Error"
                }
              }
            }
          },
          "409" : {
            "description" : "When embedding job referenced by 'jobId' request property is not completed",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security" : [ {
          "BearerAuth" : [ ]
        } ]
      }
    },
    "/v3/hashes" : {
      "get" : {
        "tags" : [ "Hashes processing" ],
        "summary" : "List of hash items data",
        "description" : "Search hash items using period (days), status or both",
        "operationId" : "apiGetHashes",
        "parameters" : [ {
          "name" : "job_id",
          "in" : "query",
          "description" : "Filtering parameter: only hash items submitted for watermark job with id 'job_id' are included in the response payload",
          "schema" : {
            "minimum" : 1,
            "type" : "integer",
            "format" : "int32"
          }
        }, {
          "name" : "status",
          "in" : "query",
          "description" : "Filtering parameter: only hash items with given processing 'status' are included in the response payload.",
          "schema" : {
            "type" : "string",
            "enum" : [ "PENDING", "IN_PROGRESS", "COMPLETE", "ERROR" ]
          }
        }, {
          "name" : "page",
          "in" : "query",
          "description" : "0-based 'page' index of the items resultset where the newest items are returned in the foremost 'page'.",
          "schema" : {
            "minimum" : 0,
            "type" : "integer",
            "format" : "int32",
            "default" : 0
          }
        }, {
          "name" : "pageSize",
          "in" : "query",
          "description" : "The number of items included in a single 'page' of the entire resultset",
          "schema" : {
            "minimum" : 0,
            "type" : "integer",
            "format" : "int32",
            "default" : 30
          }
        }, {
          "name" : "job_id",
          "in" : "query",
          "schema" : {
            "type" : "integer",
            "format" : "int64"
          }
        }, {
          "name" : "status",
          "in" : "query",
          "schema" : {
            "type" : "string",
            "enum" : [ "PENDING", "IN_PROGRESS", "COMPLETE", "ERROR" ]
          }
        }, {
          "name" : "page",
          "in" : "query",
          "schema" : {
            "type" : "integer",
            "format" : "int32",
            "default" : 0
          }
        }, {
          "name" : "pageSize",
          "in" : "query",
          "schema" : {
            "type" : "integer",
            "format" : "int32",
            "default" : 50
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "List of hash items data",
            "content" : {
              "application/json" : {
                "schema" : {
                  "type" : "array",
                  "items" : {
                    "$ref" : "#/components/schemas/WatermarkJobDataList"
                  }
                }
              }
            }
          },
          "400" : {
            "description" : "Invalid value supplied for any of specified query string parameters (job_id, status, page, pageSize)",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security" : [ {
          "BearerAuth" : [ ]
        } ]
      },
      "post" : {
        "tags" : [ "Hashes processing" ],
        "summary" : "Submit new hash processing item",
        "description" : "Submit new hash processing item",
        "operationId" : "apiCreateHash",
        "parameters" : [ ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "type" : "string",
                "example" : "{\n        \"jobId\": 1,\n        \"identityId\": 3,\n        \"patches\": [\n          {\n            \"value\": \"5bae5cb5-0b14-4bae-a55b-21fe4355cb19\",\n            \"patchId\": \"mxf_uuid\"  // fixed value\n          }\n        ]\n      }"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "201" : {
            "description" : "Hash processing item is successfully submitted",
            "headers" : {
              "Location" : {
                "description" : "Absolute URI of created hash item",
                "required" : true,
                "style" : "simple"
              }
            }
          },
          "400" : {
            "description" : "Invalid 'request' object supplied",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security" : [ {
          "BearerAuth" : [ ]
        } ]
      }
    },
    "/v3/hashes/{hash_id}" : {
      "get" : {
        "tags" : [ "Hashes processing" ],
        "summary" : "Get a hash item info",
        "description" : "Get a hash item details by given 'hash_id'",
        "operationId" : "apiGetHash",
        "parameters" : [ {
          "name" : "hash_id",
          "in" : "path",
          "description" : "Hash item ID as received when creating one",
          "required" : true,
          "schema" : {
            "minimum" : 1,
            "type" : "integer",
            "format" : "int64"
          }
        }, {
          "name" : "hash_id",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "integer",
            "format" : "int64"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "Hash item object",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CrcPreprocessData"
                }
              }
            }
          },
          "404" : {
            "description" : "No hash item can be found for 'hash_id' value",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Error"
                }
              }
            }
          },
          "400" : {
            "description" : "Invalid 'hash_id', e.g not a valid type, <0, etc.",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security" : [ {
          "BearerAuth" : [ ]
        } ]
      },
      "delete" : {
        "tags" : [ "Hashes processing" ],
        "summary" : "Delete a hash item with a given id",
        "description" : "Delete a hash item with a given id",
        "operationId" : "apiDeleteHash",
        "parameters" : [ {
          "name" : "hash_id",
          "in" : "path",
          "description" : "Hash item ID as received when creating one",
          "required" : true,
          "schema" : {
            "minimum" : 1,
            "type" : "integer",
            "format" : "int64"
          }
        }, {
          "name" : "hash_id",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "integer",
            "format" : "int64"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "When hash item has been successfully deleted"
          },
          "400" : {
            "description" : "Invalid 'hash_id', e.g not a valid type, <0, etc.",
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Error"
                }
              }
            }
          },
          "404" : {
            "description" : "No hash item can be found for 'hash_id' value",
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security" : [ {
          "BearerAuth" : [ ]
        } ]
      }
    }
  },
  "components" : {
    "schemas" : {
      "Error" : {
        "required" : [ "code" ],
        "type" : "object",
        "properties" : {
          "code" : {
            "type" : "integer",
            "format" : "int32"
          },
          "message" : {
            "type" : "string"
          }
        }
      },
      "JobsNow" : {
        "required" : [ "inProgress", "pending" ],
        "type" : "object",
        "properties" : {
          "pending" : {
            "type" : "integer",
            "format" : "int64"
          },
          "inProgress" : {
            "type" : "integer",
            "format" : "int64"
          }
        }
      },
      "JobsStats" : {
        "required" : [ "complete", "error" ],
        "type" : "object",
        "properties" : {
          "complete" : {
            "type" : "integer",
            "format" : "int64"
          },
          "error" : {
            "type" : "integer",
            "format" : "int64"
          },
          "averageDuration" : {
            "type" : "string"
          }
        }
      },
      "Status" : {
        "required" : [ "dbConnection", "error" ],
        "type" : "object",
        "properties" : {
          "jobsNow" : {
            "$ref" : "#/components/schemas/JobsNow"
          },
          "jobsStats" : {
            "$ref" : "#/components/schemas/JobsStats"
          },
          "dbConnection" : {
            "type" : "string",
            "enum" : [ "OK", "ERROR" ]
          },
          "error" : {
            "$ref" : "#/components/schemas/Error"
          }
        }
      },
      "Version" : {
        "required" : [ "version" ],
        "type" : "object",
        "properties" : {
          "version" : {
            "type" : "string"
          }
        }
      },
      "WatermarkJobData" : {
        "required" : [ "inFile", "status", "submissionTime" ],
        "type" : "object",
        "properties" : {
          "jobId" : {
            "type" : "integer",
            "format" : "int64"
          },
          "inFile" : {
            "type" : "string",
            "format" : "uri"
          },
          "status" : {
            "type" : "string",
            "enum" : [ "PENDING", "IN_PROGRESS", "COMPLETE", "ERROR" ]
          },
          "progress" : {
            "type" : "integer",
            "format" : "int32"
          },
          "error" : {
            "$ref" : "#/components/schemas/Error"
          },
          "submissionTime" : {
            "type" : "string",
            "format" : "date-time"
          },
          "startTime" : {
            "type" : "string",
            "format" : "date-time"
          },
          "completionTime" : {
            "type" : "string",
            "format" : "date-time"
          }
        }
      },
      "WatermarkJobDataList" : {
        "required" : [ "jobs" ],
        "type" : "object",
        "properties" : {
          "jobs" : {
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/WatermarkJobData"
            }
          }
        }
      },
      "TenantSpecParam" : {
        "type" : "object",
        "properties" : {
          "tenantCategory" : {
            "type" : "string",
            "enum" : [ "TENANTS", "CLIENTS" ]
          },
          "tenantId" : {
            "type" : "string"
          }
        }
      },
      "WatermarkJobRequest" : {
        "required" : [ "inFile" ],
        "type" : "object",
        "properties" : {
          "inFile" : {
            "type" : "string",
            "format" : "uri"
          }
        }
      },
      "TenantInfo" : {
        "required" : [ "tenantId" ],
        "type" : "object",
        "properties" : {
          "tenantId" : {
            "type" : "string"
          }
        }
      },
      "TransferData" : {
        "required" : [ "id", "identityId", "jobId", "status" ],
        "type" : "object",
        "properties" : {
          "id" : {
            "type" : "integer",
            "format" : "int64"
          },
          "identityId" : {
            "type" : "integer",
            "format" : "int64"
          },
          "jobId" : {
            "type" : "integer",
            "format" : "int64"
          },
          "status" : {
            "type" : "string",
            "enum" : [ "PENDING", "READY", "IN_PROGRESS", "COMPLETE", "ERROR" ]
          },
          "progress" : {
            "type" : "number",
            "format" : "float"
          },
          "submissionTime" : {
            "type" : "string",
            "format" : "date-time"
          },
          "startTime" : {
            "type" : "string",
            "format" : "date-time"
          },
          "completionTime" : {
            "type" : "string",
            "format" : "date-time"
          },
          "error" : {
            "$ref" : "#/components/schemas/Error"
          },
          "destination" : {
            "type" : "string",
            "format" : "uri"
          },
          "result" : {
            "$ref" : "#/components/schemas/TransferResult"
          },
          "tenantInfo" : {
            "$ref" : "#/components/schemas/TenantInfo"
          }
        }
      },
      "TransferResult" : {
        "required" : [ "processedBytes" ],
        "type" : "object",
        "properties" : {
          "processedBytes" : {
            "type" : "integer",
            "format" : "int64"
          },
          "totalBytes" : {
            "type" : "integer",
            "format" : "int64"
          }
        }
      },
      "TransferRequest" : {
        "required" : [ "identityId", "jobId" ],
        "type" : "object",
        "properties" : {
          "identityId" : {
            "type" : "integer",
            "format" : "int64"
          },
          "jobId" : {
            "type" : "integer",
            "format" : "int64"
          },
          "destination" : {
            "type" : "string",
            "format" : "uri"
          }
        }
      },
      "CrcPreprocessData" : {
        "required" : [ "id", "identityId", "jobId", "patches", "progress", "status", "submissionTime" ],
        "type" : "object",
        "properties" : {
          "id" : {
            "type" : "integer",
            "format" : "int64"
          },
          "jobId" : {
            "type" : "integer",
            "format" : "int64"
          },
          "identityId" : {
            "type" : "integer",
            "format" : "int64"
          },
          "patches" : {
            "uniqueItems" : true,
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/PatchEntryDTO"
            }
          },
          "status" : {
            "type" : "string",
            "enum" : [ "PENDING", "IN_PROGRESS", "COMPLETE", "ERROR" ]
          },
          "progress" : {
            "type" : "integer",
            "format" : "int32"
          },
          "error" : {
            "$ref" : "#/components/schemas/Error"
          },
          "hashDigest" : {
            "type" : "string"
          },
          "submissionTime" : {
            "type" : "string",
            "format" : "date-time"
          },
          "startTime" : {
            "type" : "string",
            "format" : "date-time"
          },
          "completionTime" : {
            "type" : "string",
            "format" : "date-time"
          }
        }
      },
      "PatchEntryDTO" : {
        "type" : "object",
        "properties" : {
          "value" : {
            "type" : "string"
          },
          "patchId" : {
            "type" : "string",
            "enum" : [ "mxf_uuid", "pps" ]
          }
        }
      },
      "CrcPreprocessRequest" : {
        "required" : [ "identityId", "jobId" ],
        "type" : "object",
        "properties" : {
          "jobId" : {
            "type" : "integer",
            "format" : "int64"
          },
          "identityId" : {
            "type" : "integer",
            "format" : "int64"
          },
          "patches" : {
            "uniqueItems" : true,
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/PatchEntryDTO"
            }
          }
        }
      }
    },
    "securitySchemes" : {
      "OAuth2ClientCredentials" : {
        "type" : "oauth2",
        "flows" : {
          "clientCredentials" : {
            "tokenUrl" : "/oauth/token",
            "scopes" : {
              "dwm:jobs" : "Grants access to the /v3/jobs APIs",
              "dwm:transfers" : "Grants access to the /v3/transfers APIs",
              "dwm:identity" : "Grants access to the /v3/identity API"
            }
          }
        }
      },
      "Auth0ClientCredentials" : {
        "type" : "oauth2",
        "flows" : {
          "clientCredentials" : {
            "tokenUrl" : "https://irdeto.auth0.com/oauth/token",
            "scopes" : {
              "dwm:jobs" : "Grants access to the /v3/jobs APIs",
              "dwm:transfers" : "Grants access to the /v3/transfers APIs",
              "dwm:identity" : "Grants access to the /v3/identity API",
              "dwm:admin" : "Grants access to all /v3 APIs"
            }
          }
        }
      },
      "BearerAuth" : {
        "type" : "http",
        "scheme" : "bearer",
        "bearerFormat" : "JWT"
      }
    }
  }
}