{
  "openapi": "3.0.0",
  "info": {
    "description": "APIs to help ensure compliance with legal data governance when dealing with data in the Data Ecosystem.\n\n```plain {% title=\"Client ID\" %}\n963f2cc6915e479fa0fcb73ec2ec90e7\n```\n",
    "version": "1.0.0",
    "x-product-id": "OSDU-Compliance-Service",
    "title": "Legal data governance APIs",
    "contact": {
      "name": "SLB Customer Support for Digital",
      "url": "https://customersupport.digital.slb.com"
    }
  },
  "tags": [
    {
      "name": "LegalTag",
      "description": ""
    },
    {
      "name": "Info",
      "description": "Build and git information."
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "servers": [
    {
      "url": "https://as5.api.enterprisedata.slb.com/api/legal/v1",
      "description": "SLB Saas OSDU (SGP)"
    },
    {
      "url": "https://br5.api.enterprisedata.slb.com/api/legal/v1",
      "description": "SLB SaaS OSDU (BRS)"
    },
    {
      "url": "https://eu5.api.enterprisedata.slb.com/api/legal/v1",
      "description": "SLB Saas OSDU (WEU)"
    },
    {
      "url": "https://eu6.api.enterprisedata.slb.com/api/legal/v1",
      "description": "SLB SaaS OSDU (EUT)"
    },
    {
      "url": "https://eu7.api.enterprisedata.slb.com/api/legal/v1",
      "description": "SLB Saas OSDU (MDE)"
    },
    {
      "url": "https://us5.api.enterprisedata.slb.com/api/legal/v1",
      "description": "SLB Saas OSDU (PSC)"
    },
    {
      "url": "https://us7.api.enterprisedata.slb.com/api/legal/v1",
      "description": "SLB Saas OSDU (USC)"
    },
    {
      "url": "https://us8.api.enterprisedata.slb.com/api/legal/v1",
      "description": "SLB Saas OSDU (WUS)"
    },
    {
      "url": "https://as6.api.enterprisedata.slb.com/api/legal/v1",
      "description": "SLB Saas OSDU (SAS)"
    },
    {
      "url": "https://eu8.api.enterprisedata.slb.com/api/legal/v1",
      "description": "SLB Saas OSDU (SWC)"
    },
    {
      "url": "https://as7.api.enterprisedata.slb.com/api/legal/v1",
      "description": "SLB Saas OSDU (MYW)"
    },
    {
      "url": "https://za1.api.enterprisedata.slb.com/api/legal/v1",
      "description": "SLB Saas OSDU (ZAN)"
    }
  ],
  "paths": {
    "/legaltags:batchRetrieve": {
      "post": {
        "tags": [
          "LegalTag"
        ],
        "summary": "Get the LegalTags",
        "description": "Retrieve your LegalTags using the associated name. A maximum of 25 can be retrieved at once. Allowed roles: users.datalake.viewers, users.datalake.editors, users.datalake.admins",
        "operationId": "Get the LegalTags",
        "parameters": [
          {
            "$ref": "#/components/parameters/data-partition-id"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/RequestLegalTags"
        },
        "responses": {
          "200": {
            "description": "Retrieved LegalTags successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegalTagDtos"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters were given on request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "404": {
            "description": "One or more requested LegalTags were not found.",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/legaltags/{name}": {
      "get": {
        "tags": [
          "LegalTag"
        ],
        "summary": "Get a LegalTag",
        "description": "Retrieve your LegalTag using the associated name. Allowed roles: users.datalake.viewers, users.datalake.editors, users.datalake.admins",
        "operationId": "Get a LegalTag",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "The name of the LegalTag to retrieve.",
            "required": true,
            "example": "Some-Private-USA-EHC",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/data-partition-id"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieved LegalTag successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegalTagDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters were given on request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "404": {
            "description": "Requested LegalTag was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/legaltags": {
      "get": {
        "tags": [
          "LegalTag"
        ],
        "summary": "List the LegalTags",
        "description": "Retrieve all LegalTags. You can specify parameters to choose what subset of LegalTags you want to list. Allowed roles: users.datalake.viewers, users.datalake.editors, users.datalake.admins",
        "operationId": "List the LegalTags",
        "parameters": [
          {
            "name": "valid",
            "in": "query",
            "description": "If true returns only valid LegalTags, if false returns only invalid LegalTags.  Default value is true.",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "$ref": "#/components/parameters/data-partition-id"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieved LegalTags successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegalTagDtos"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters were given on request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "LegalTag"
        ],
        "summary": "Create a LegalTag",
        "description": "Create LegalTag, whose unique identifier is name. A valid LegalTag is required for data ingestion to ensure the data compliance. Allowed roles: users.datalake.editors, users.datalake.admins",
        "operationId": "Create a LegalTag",
        "parameters": [
          {
            "$ref": "#/components/parameters/data-partition-id"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegalTagDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created LegalTag successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegalTagDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters were given on request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "409": {
            "description": "A LegalTag with the given name already exists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "put": {
        "tags": [
          "LegalTag"
        ],
        "summary": "Update a LegalTag",
        "description": "Update certain properties of your LegalTag using the name associated with it. Currently we only allow the update of the description, contract ID and expiration date properties. Allowed roles: users.datalake.editors, users.datalake.admins",
        "operationId": "Update a LegalTag",
        "parameters": [
          {
            "$ref": "#/components/parameters/data-partition-id"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateLegalTag"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated LegalTag successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegalTagDto"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters were given on request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "404": {
            "description": "Requested LegalTag to update was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/legaltags:validate": {
      "post": {
        "tags": [
          "LegalTag"
        ],
        "summary": "Validate the LegalTags",
        "description": "Validate a list of LegalTags. For invalid tags, the reason of invalidity will also be returned. A maximum of 25 can be retrieved at once. Allowed roles: users.datalake.viewers, users.datalake.editors, users.datalake.admins",
        "operationId": "Validate the LegalTags",
        "parameters": [
          {
            "$ref": "#/components/parameters/data-partition-id"
          }
        ],
        "requestBody": {
          "$ref": "#/components/requestBodies/RequestLegalTags"
        },
        "responses": {
          "200": {
            "description": "Retrieved LegalTag names with reason successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidTagsWithReason"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters were given on request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/legaltags:properties": {
      "get": {
        "tags": [
          "LegalTag"
        ],
        "summary": "Get the allowed LegalTag values",
        "description": "Retrieve allowed values for the given data partition for LegalTag properties when creating a LegalTag. Allowed roles: users.datalake.viewers, users.datalake.editors, users.datalake.admins",
        "operationId": "Get the allowed LegalTag values",
        "parameters": [
          {
            "$ref": "#/components/parameters/data-partition-id"
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieved properties successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadablePropertyValues"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/info": {
      "get": {
        "tags": [
          "Info"
        ],
        "summary": "Version info",
        "description": "For deployment available public `/info` endpoint,  which provides build and git related information.",
        "operationId": "Version info",
        "responses": {
          "200": {
            "description": "Version info.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionInfo"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "data-partition-id": {
        "name": "data-partition-id",
        "in": "header",
        "description": "desired data partition id",
        "required": true,
        "schema": {
          "type": "string"
        }
      }
    },
    "requestBodies": {
      "RequestLegalTags": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/RequestLegalTags"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "User Token from SLB Authenticator Service"
      }
    },
    "schemas": {
      "AppError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "format": "int32"
          },
          "reason": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "description": "An error that occurs during normal application logic"
      },
      "LegalTagDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Some-Private-EHCData",
            "description": "The name of the LegalTag."
          },
          "description": {
            "type": "string",
            "description": "The description of the LegalTag."
          },
          "properties": {
            "$ref": "#/components/schemas/Properties"
          }
        },
        "description": "Represents a single LegalTag.",
        "example": {
          "name": "slb-osdu-prod-des-prod-testing-public-usa-dataset-1",
          "description": "A LegalTag used for demonstration purposes.",
          "properties": {
            "countryOfOrigin": [
              "US"
            ],
            "contractId": "Unknown",
            "expirationDate": "2099-01-01",
            "originator": "OSDU",
            "dataType": "Public Domain Data",
            "securityClassification": "Public",
            "personalData": "No Personal Data",
            "exportClassification": "Not - Technical Data"
          }
        }
      },
      "LegalTagDtos": {
        "type": "object",
        "properties": {
          "legalTags": {
            "type": "array",
            "description": "A collection of complete LegalTags",
            "items": {
              "$ref": "#/components/schemas/LegalTagDto"
            }
          }
        },
        "description": "Represents a collection of LegalTags."
      },
      "Properties": {
        "type": "object",
        "required": [
          "contractId",
          "countryOfOrigin",
          "dataType",
          "exportClassification",
          "originator",
          "personalData",
          "securityClassification"
        ],
        "properties": {
          "countryOfOrigin": {
            "type": "array",
            "example": [
              "US"
            ],
            "description": "The ISO Alpha 2 country code(s) of where the data relates to.",
            "items": {
              "type": "string"
            }
          },
          "contractId": {
            "type": "string",
            "example": "Some Contract Id",
            "description": "The Id of the physical contract associated with the data being ingested."
          },
          "expirationDate": {
            "type": "string",
            "example": "2025-12-25",
            "description": "The optional expiration date of the contract in the format YYYY-MM-DD"
          },
          "originator": {
            "type": "string",
            "example": "CompanyName",
            "description": "The company who owns the data."
          },
          "dataType": {
            "type": "string",
            "example": "Third Party Data",
            "description": "The type of data being ingested."
          },
          "securityClassification": {
            "type": "string",
            "example": "Private",
            "description": "The security classification of the data."
          },
          "personalData": {
            "type": "string",
            "example": "No Personal Data",
            "description": "Whether the data contains any personally identifiable data."
          },
          "exportClassification": {
            "type": "string",
            "example": "EAR99",
            "description": "The ECCN value of the data if one applies."
          }
        },
        "description": "LegalTag properties"
      },
      "RequestLegalTags": {
        "type": "object",
        "required": [
          "names"
        ],
        "properties": {
          "names": {
            "type": "array",
            "description": "The name of all the LegalTags to retrieve.",
            "items": {
              "type": "string"
            },
            "maxItems": 25,
            "minItems": 1
          }
        },
        "description": "The model to retrieve multiple LegalTags in batch.",
        "example": {
          "names": [
            "slb-osdu-prod-des-prod-testing-public-usa-dataset-1"
          ]
        }
      },
      "UpdateLegalTag": {
        "type": "object",
        "required": [
          "contractId",
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the LegalTag."
          },
          "contractId": {
            "type": "string",
            "example": "Some Contract Id",
            "description": "The Id of the physical contract associated with the data being ingested."
          },
          "description": {
            "type": "string",
            "description": "The optional description if the LegalTag to allow for easier discoverability of LegalTags overtime."
          },
          "expirationDate": {
            "type": "string",
            "example": "2025-12-25",
            "description": "The optional expiration date of the contract in the format YYYY-MM-DD"
          }
        },
        "description": "The model to update an existing LegalTag",
        "example": {
          "name": "slb-osdu-prod-des-prod-testing-public-usa-mydataset-1",
          "contractId": "Unknown",
          "description": "An update on the demonstration LegalTag",
          "expirationDate": "2099-01-01"
        }
      },
      "InvalidTagWithReason": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the LegalTag."
          },
          "reason": {
            "type": "string",
            "description": "The reason the LegalTag is currently invalid."
          }
        },
        "description": "Represents a single invalid LegalTag."
      },
      "InvalidTagsWithReason": {
        "type": "object",
        "properties": {
          "invalidLegalTags": {
            "type": "array",
            "description": "A collection of invalid LegalTags.",
            "items": {
              "$ref": "#/components/schemas/InvalidTagWithReason"
            }
          }
        },
        "description": "Represents a collection invalid LegalTags."
      },
      "ReadablePropertyValues": {
        "type": "object",
        "properties": {
          "countriesOfOrigin": {
            "type": "object",
            "description": "The values of all the allowed Countries of Origin with the ISO Alpha 2 code and country name.",
            "additionalProperties": {
              "type": "string"
            }
          },
          "otherRelevantDataCountries": {
            "type": "object",
            "description": "The values of all the allowed Other Relevant Data Countries with the ISO Alpha 2 code and country name.",
            "additionalProperties": {
              "type": "string"
            }
          },
          "securityClassifications": {
            "type": "array",
            "description": "The values of all the allowed Security Classifications.",
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          },
          "exportClassificationControlNumbers": {
            "type": "array",
            "description": "The name of all the allowed Export Classifications.",
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          },
          "personalDataTypes": {
            "type": "array",
            "description": "The name of all the allowed Personal Data Type values.",
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          },
          "dataTypes": {
            "type": "array",
            "description": "The name of all the allowed Data Type values.",
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          }
        },
        "description": "Shows the allowed values of the fields of a LegalTag."
      },
      "VersionInfo": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "string",
            "description": "Maven artifact group ID."
          },
          "actifactId": {
            "type": "string",
            "description": "Maven artifact ID."
          },
          "version": {
            "type": "string",
            "description": "Maven artifact version"
          },
          "buildTime": {
            "type": "string",
            "description": "Maven artifact build time"
          },
          "branch": {
            "type": "string",
            "description": "Current git branch"
          },
          "commitId": {
            "type": "string",
            "description": "Latest commit hash"
          },
          "commitMessage": {
            "type": "string",
            "description": "Latest commit message"
          },
          "connectedOuterServices": {
            "type": "array",
            "description": "Connected outer services information",
            "items": {
              "$ref": "#/components/schemas/ConnectedOuterService"
            }
          }
        },
        "description": "Version info."
      },
      "ConnectedOuterService": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Connected outer service name."
          },
          "version": {
            "type": "string",
            "description": "Connected outer service version."
          }
        },
        "description": "Connected outer service information."
      }
    }
  }
}