{
  "openapi": "3.0.0",
  "info": {
    "description": "Storage service which handles the metadata ingestion in the Managed Planning Data Foundation\n\n```plain {% title=\"Client ID\" %}\n963f2cc6915e479fa0fcb73ec2ec90e7\n```\n",
    "version": "2.0.0",
    "x-product-id": "OSDU-Storage-Service",
    "title": "Storage APIs",
    "contact": {
      "name": "SLB Customer Support for Digital",
      "url": "https://customersupport.digital.slb.com"
    }
  },
  "servers": [
    {
      "url": "https://as5.api.enterprisedata.slb.com/api/storage/v2",
      "description": "SLB Saas OSDU (SGP)"
    },
    {
      "url": "https://br5.api.enterprisedata.slb.com/api/storage/v2",
      "description": "SLB SaaS OSDU (BRS)"
    },
    {
      "url": "https://eu5.api.enterprisedata.slb.com/api/storage/v2",
      "description": "SLB Saas OSDU (WEU)"
    },
    {
      "url": "https://eu6.api.enterprisedata.slb.com/api/storage/v2",
      "description": "SLB SaaS OSDU (EUT)"
    },
    {
      "url": "https://eu7.api.enterprisedata.slb.com/api/storage/v2",
      "description": "SLB Saas OSDU (MDE)"
    },
    {
      "url": "https://us5.api.enterprisedata.slb.com/api/storage/v2",
      "description": "SLB Saas OSDU (PSC)"
    },
    {
      "url": "https://us7.api.enterprisedata.slb.com/api/storage/v2",
      "description": "SLB Saas OSDU (USC)"
    },
    {
      "url": "https://us8.api.enterprisedata.slb.com/api/storage/v2",
      "description": "SLB Saas OSDU (WUS)"
    },
    {
      "url": "https://as6.api.enterprisedata.slb.com/api/storage/v2",
      "description": "SLB Saas OSDU (SAS)"
    },
    {
      "url": "https://eu8.api.enterprisedata.slb.com/api/storage/v2",
      "description": "SLB Saas OSDU (SWC)"
    },
    {
      "url": "https://as7.api.enterprisedata.slb.com/api/storage/v2",
      "description": "SLB Saas OSDU (MYW)"
    },
    {
      "url": "https://za1.api.enterprisedata.slb.com/api/storage/v2",
      "description": "SLB Saas OSDU (ZAN)"
    }
  ],
  "tags": [
    {
      "name": "Records",
      "description": "Records management operations."
    },
    {
      "name": "Schemas",
      "description": "Schema management"
    },
    {
      "name": "Query",
      "description": "Record queries"
    },
    {
      "name": "Info",
      "description": "Build and git information"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "paths": {
    "/query/kinds": {
      "get": {
        "tags": [
          "Query"
        ],
        "summary": "Get all kinds",
        "description": "The API returns a list of all kinds with schema registered in Storage service in the specific {data-partition-id}. Default page size limit is 1000. Required roles: 'users.datalake.viewers' or 'users.datalake.editors' or 'users.datalake.admins'.",
        "operationId": "Get all kinds",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page Size",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "$ref": "#/components/parameters/data-partition-id"
          }
        ],
        "responses": {
          "200": {
            "description": "All kinds retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatastoreQueryResult"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "429": {
            "description": "Request rate is too large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "500": {
            "description": "Unknown Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/query/records:batch": {
      "post": {
        "tags": [
          "Query"
        ],
        "summary": "Fetch multiple records",
        "description": "The API fetches multiple records at once in the specific {data-partition-id}. The value of {frame-of-reference} indicates whether normalization is applied. Required roles: 'users.datalake.viewers' or 'users.datalake.editors' or 'users.datalake.admins'.",
        "operationId": "Fetch multiple records",
        "parameters": [
          {
            "$ref": "#/components/parameters/data-partition-id"
          },
          {
            "name": "frame-of-reference",
            "in": "header",
            "description": "This value indicates whether normalization applies, should be either 'none' or 'units=SI;crs=wgs84;elevation=msl;azimuth=true north;dates=utc;'",
            "required": true,
            "schema": {
              "type": "string",
              "default": "units=SI;crs=wgs84;elevation=msl;azimuth=true north;dates=utc;"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordIds"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MultiRecordResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "429": {
            "description": "Request rate is too large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "500": {
            "description": "Unknown error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/query/records": {
      "post": {
        "tags": [
          "Query"
        ],
        "summary": "Fetch records",
        "description": "The API fetches multiple records at once. Allowed roles: 'users.datalake.viewers' or 'users.datalake.editors' or 'users.datalake.admins'.",
        "operationId": "Fetch records",
        "parameters": [
          {
            "$ref": "#/components/parameters/data-partition-id"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordIds"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Fetch multiple records successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MultiRecordInfo"
                }
              }
            }
          },
          "429": {
            "description": "Request rate is too large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "500": {
            "description": "Unknown storage error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/records/{id}:delete": {
      "post": {
        "tags": [
          "Records"
        ],
        "summary": "Delete record",
        "description": "The API performs a logical deletion of the given record. This operation can be reverted later. Required roles: 'users.datalake.editors' or 'users.datalake.admins' who is the OWNER of the record.",
        "operationId": "Delete record",
        "parameters": [
          {
            "name": "id",
            "$ref": "#/components/parameters/record-id"
          },
          {
            "$ref": "#/components/parameters/data-partition-id"
          }
        ],
        "responses": {
          "204": {
            "description": "Record deleted successfully."
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "404": {
            "description": "Record not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "429": {
            "description": "Request rate is too large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/records/delete": {
      "post": {
        "tags": [
          "Records"
        ],
        "summary": "Soft delete of multiple records",
        "description": "The API performs a soft deletion of the given list of records. Required roles: 'users.datalake.editors' or 'users.datalake.admins' who is the OWNER of the record.",
        "operationId": "Delete records",
        "parameters": [
          {
            "name": "data-partition-id",
            "in": "header",
            "description": "This value should be the desired data partition id.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "osdu"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "All records deleted successfully."
          },
          "207": {
            "description": "Some of the records weren't deleted successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DeleteRecordsException"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid id format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "429": {
            "description": "Request rate is too large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/records": {
      "put": {
        "tags": [
          "Records"
        ],
        "summary": "Create or update records",
        "description": "The API represents the main injection mechanism into the Data Platform. It allows records creation and/or update. When no record id is provided or when the provided id is not already present in the Data Platform then a new record is created. If the id is related to an existing record in the Data Platform then an update operation takes place and a new version of the record is created. Required roles: 'users.datalake.editors' or 'users.datalake.admins'.",
        "operationId": "Create or update records",
        "parameters": [
          {
            "name": "skipdupes",
            "in": "query",
            "description": "Skip duplicates when updating records with the same value.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "$ref": "#/components/parameters/data-partition-id"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Record"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Records created and/or updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateUpdateRecordsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid record format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "403": {
            "description": "User not authorized to perform the action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "404": {
            "description": "Invalid acl group.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "429": {
            "description": "Request rate is too large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Records"
        ],
        "summary": "Modify record data and/or metadata attributes using patch operations",
        "description": "The API represents the patch update mechanism for records. It allows updating multiple records in one request. The API supports metadata update only (Legal Tags, ACLs and Tags) if the request body media type is `application/json`. The API supports metadata and data update (Legal Tags, ACLs, Tags, Ancestry, Kind, Meta and Data) if the request body media type is `application/json-patch+json`. Please choose the appropriate media type from the Request body dropdown. The currently supported operations are replace, add, and remove. Required roles: `users.datalake.editors` or `users.datalake.admins`.",
        "operationId": "Patch Records",
        "parameters": [
          {
            "$ref": "#/components/parameters/data-partition-id"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchRecordsRequestBody"
              }
            },
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PatchRecordsRequestBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Records metaData updated successfully. All records' metadata was updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkUpdateRecordsResponse"
                }
              },
              "application/json-patch+json": {
                "schema": {
                  "$ref": "#/components/schemas/PatchRecordsResponse"
                }
              }
            }
          },
          "206": {
            "description": "Records metaData update partially succeeded. Some records were not updated due to reasons like records not found, records were locked, and user not authorized to update records.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkUpdateRecordsResponse"
                }
              },
              "application/json-patch+json": {
                "schema": {
                  "$ref": "#/components/schemas/PatchRecordsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "403": {
            "description": "User not authorized to perform the action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "429": {
            "description": "Request rate is too large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/records/{id}/versions": {
      "delete": {
        "tags": [
          "Records"
        ],
        "summary": "Purge record versions",
        "description": "The API for the given record id, performs the permanent physical deletion record versions excluding latest version and any linked records or files if there are any. If 'limit' query parameter is used then it will delete oldest versions defined by 'limit'. This operation cannot be undone. Required roles: 'users.datalake.admins' who is the OWNER of the record.",
        "operationId": "Purge record versions",
        "parameters": [
          {
            "name": "id",
            "$ref": "#/components/parameters/record-id"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Number of oldest record versions to be deleted. Value must not exceed number of record versions (excluding latest version)",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "data-partition-id",
            "in": "header",
            "description": "Tenant Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Record Versions deleted successfully."
          },
          "400": {
            "description": "Validation error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "403": {
            "description": "User not authorized to perform the action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "404": {
            "description": "Record not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "429": {
            "description": "Request rate is too large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "500": {
            "description": "Unknown Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          }
        },
        "security": [
          {
            "Authorization": []
          }
        ]
      }
    },
    "/records/versions/{id}": {
      "get": {
        "tags": [
          "Records"
        ],
        "summary": "Get all record versions",
        "description": "The API returns a list containing all versions for the given record id. Required roles: 'users.datalake.viewers' or 'users.datalake.editors' or 'users.datalake.admins'.",
        "operationId": "Get all record versions",
        "parameters": [
          {
            "name": "id",
            "$ref": "#/components/parameters/record-id"
          },
          {
            "$ref": "#/components/parameters/data-partition-id"
          }
        ],
        "responses": {
          "200": {
            "description": "Record versions retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordVersions"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "404": {
            "description": "Record id or version not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "429": {
            "description": "Request rate is too large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/records/{id}/{version}": {
      "get": {
        "tags": [
          "Records"
        ],
        "summary": "Get record version",
        "description": "The API retrieves the specific version of the given record. Required roles: 'users.datalake.viewers' or 'users.datalake.editors' or 'users.datalake.admins'.",
        "operationId": "Get record version",
        "parameters": [
          {
            "name": "id",
            "$ref": "#/components/parameters/record-id"
          },
          {
            "name": "version",
            "in": "path",
            "description": "Record version",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "attribute",
            "in": "query",
            "description": "Filter attributes to restrict the returned fields of the record. Usage: data.{record-data-field-name}.",
            "required": false,
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "$ref": "#/components/parameters/data-partition-id"
          }
        ],
        "responses": {
          "200": {
            "description": "Record retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Record"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "404": {
            "description": "Record id or version not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "429": {
            "description": "Request rate is too large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/records/{id}": {
      "get": {
        "tags": [
          "Records"
        ],
        "summary": "Get record",
        "description": "This API returns the latest version of the given record. Required roles: 'users.datalake.viewers' or 'users.datalake.editors' or 'users.datalake.admins'.",
        "operationId": "Get record",
        "parameters": [
          {
            "name": "id",
            "$ref": "#/components/parameters/record-id"
          },
          {
            "name": "attribute",
            "in": "query",
            "description": "Filter attributes to restrict the returned fields of the record. Usage: data.{record-data-field-name}.",
            "required": false,
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "$ref": "#/components/parameters/data-partition-id"
          }
        ],
        "responses": {
          "200": {
            "description": "Record retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Record"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "404": {
            "description": "Record not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "429": {
            "description": "Request rate is too large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Records"
        ],
        "summary": "Purge record",
        "description": "The API performs the permanent physical deletion of the given record and all of its versions not including any linked records or files if there are any. It is recommended to clean up all the linked records such as child records, records in relationship block, and actual data (file ingested via Submit API in Ingestion Service) to avoid having an orphaned data after using purge API. This operation cannot be undone. Required roles: 'users.datalake.admins' who is the OWNER of the record.",
        "operationId": "Purge record",
        "parameters": [
          {
            "name": "id",
            "$ref": "#/components/parameters/record-id"
          },
          {
            "$ref": "#/components/parameters/data-partition-id"
          }
        ],
        "responses": {
          "204": {
            "description": "Record deleted successfully."
          },
          "400": {
            "description": "Validation error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "403": {
            "description": "User not authorized to perform the action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "404": {
            "description": "Record not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "429": {
            "description": "Request rate is too large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "500": {
            "description": "Unknown Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/schemas/{kind}": {
      "get": {
        "tags": [
          "Schemas"
        ],
        "summary": "Get schema",
        "description": "The API returns the schema specified by the given kind, which must follow the naming convention {data-partition-id}:{dataset}:{type}:{version}. Required roles: 'users.datalake.viewers' or 'users.datalake.editors' or 'users.datalake.admins'",
        "deprecated": true,
        "operationId": "Get schema",
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "description": "Kind",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/data-partition-id"
          }
        ],
        "responses": {
          "200": {
            "description": "Schema obtained successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Schema"
                }
              }
            }
          },
          "400": {
            "description": "Bad request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "404": {
            "description": "Schema not found for specified kind.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "429": {
            "description": "Request rate is too large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/schemas": {
      "post": {
        "tags": [
          "Schemas"
        ],
        "summary": "Create schema",
        "description": "The API allows the creation of a new schema for the given kind. Required roles: 'users.datalake.editors' or 'users.datalake.admins'.",
        "deprecated": true,
        "operationId": "Create schema",
        "parameters": [
          {
            "$ref": "#/components/parameters/data-partition-id"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Schema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Schema created successfully."
          },
          "400": {
            "description": "Bad request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "409": {
            "description": "Schema already registered.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppError"
                }
              }
            }
          },
          "429": {
            "description": "Request rate is too large.",
            "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"
        }
      },
      "record-id": {
        "name": "id",
        "in": "path",
        "description": "Record id\n\n<b>Note: </b>If the Record ID contains encoded characters (e.g., %5B, %5D, etc.),\nensure that you url-encode the Record ID to avoid issues with URL decoding.\nFor example, if your Record ID is `opendes:test:%5BUS%5D`, you should encode it as `opendes%3Atest%3A%255BUS%255D`.\n",
        "required": true,
        "schema": {
          "type": "string"
        }
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "User Token from SLB Authenticator Service"
      }
    },
    "schemas": {
      "DatastoreQueryResult": {
        "type": "object",
        "properties": {
          "cursor": {
            "type": "string"
          },
          "results": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "AppError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "format": "int32"
          },
          "reason": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "description": "An error that occurs during normal application logic"
      },
      "DeleteRecordsException": {
        "type": "object",
        "properties": {
          "notDeletedRecordId": {
            "type": "string",
            "example": "osdu:welldb:123456",
            "description": "Record id which wasn't deleted successfully."
          },
          "message": {
            "type": "string",
            "example": "Record with id 'osdu:welldb:123456' not found",
            "description": "Brief description of the cause why record wasn't delete"
          }
        },
        "description": "Delete Records Response Body"
      },
      "CreateUpdateRecordsResponse": {
        "type": "object",
        "properties": {
          "recordCount": {
            "type": "integer",
            "format": "int32",
            "description": "Number of records ingested successfully."
          },
          "recordIds": {
            "type": "array",
            "description": "List of ingested record id.",
            "items": {
              "type": "string"
            }
          },
          "skippedRecordIds": {
            "type": "array",
            "description": "List of record id that skipped update because it was a duplicate of the existing record.",
            "items": {
              "type": "string"
            }
          }
        },
        "description": "Result of the ingestion request."
      },
      "Legal": {
        "type": "object",
        "properties": {
          "legaltags": {
            "type": "array",
            "description": "List of legaltag names associated with the record. When 'ancestry.parents' are provided, this field is not mandatory.",
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          },
          "otherRelevantDataCountries": {
            "type": "array",
            "description": "List of other relevant data countries. Must contain the ISO 3166 Alpha-2 code of the country where the data was ingested from. When 'ancestry.parents' are provided, this field is not mandatory.",
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Record": {
        "description": "Storage record.",
        "type": "object",
        "required": [
          "legal",
          "data",
          "acl",
          "kind"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "slb-osdu-prod-des-prod-testing:work-product-component--WellLog:a6d6-63fc9a0bbac1",
            "description": "Unique identifier in whole Data Platform. When not provided, Data Platform will create and assign an id to the record. Should follow the naming convention: {data-partition-id}:{object-type}:{uuid}."
          },
          "kind": {
            "type": "string",
            "example": "slb-osdu-prod-des-prod-testing:wks:work-product-component--WellLog:1.0.0",
            "description": "Kind of data it is being ingested. Must follow the naming convention: {authority/data-partition-id}:{source}:{entity-type}:{major}.{minor}.{patch}."
          },
          "acl": {
            "$ref": "#/components/schemas/StorageAcl"
          },
          "legal": {
            "$ref": "#/components/schemas/Legal"
          },
          "data": {
            "type": "object",
            "description": "Record payload represented as a list of key-value pairs."
          },
          "ancestry": {
            "$ref": "#/components/schemas/RecordAncestry"
          },
          "meta": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MetaBlock"
            },
            "description": "An array of elements collecting the frame of reference(FoR) information in records."
          }
        },
        "example": {
          "id": "slb-osdu-prod-des-prod-testing:work-product-component--WellLog:a6d6-63fc9a0bbac1",
          "kind": "slb-osdu-prod-des-prod-testing:wks:work-product-component--WellLog:1.0.0",
          "acl": {
            "viewers": [
              "data.default.viewers@{datapartition}.{domain}.com"
            ],
            "owners": [
              "data.default.owners@{datapartition}.{domain}.com"
            ]
          },
          "legal": {
            "legaltags": [
              "slb-osdu-prod-des-prod-testing-sample-legaltag"
            ],
            "otherRelevantDataCountries": [
              "US"
            ]
          },
          "data": {
            "msg": "hello world, from Data Platform"
          },
          "meta": [
            {
              "kind": "Unit",
              "persistableReference": "{\"scaleOffset\":{\"scale\":1.0,\"offset\":0.0},\"symbol\":\"m\",\"baseMeasurement\":{\"ancestry\":\"Length\",\"type\":\"UM\"},\"type\":\"USO\"}",
              "propertyNames": [
                "ElevM"
              ],
              "name": "m"
            }
          ]
        }
      },
      "RecordIds": {
        "type": "object",
        "required": [
          "records"
        ],
        "properties": {
          "records": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "slb-osdu-prod-des-prod-testing:work-product-component--WellLog:a6d6-63fc9a0bbac1"
            ],
            "description": "List of record ids need to be fetched."
          }
        },
        "description": "Fetch Records Request Body",
        "example": {
          "records": [
            "slb-osdu-prod-des-prod-testing:work-product-component--WellLog:a6d6-63fc9a0bbac1",
            "slb-osdu-prod-des-prod-testing:work-product-component--WellLog:a6d6-63fc9a0bbac2"
          ]
        }
      },
      "MetaBlock": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string"
          },
          "persistableReference": {
            "type": "string"
          },
          "propertyNames": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "name": {
            "type": "string"
          }
        }
      },
      "RecordAncestry": {
        "type": "object",
        "properties": {
          "parents": {
            "type": "array",
            "description": "List of parent records. Must follow the naming convention: {parent-record-id}:{parent-record-version}.",
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          }
        }
      },
      "StorageAcl": {
        "type": "object",
        "required": [
          "owners",
          "viewers"
        ],
        "properties": {
          "viewers": {
            "type": "array",
            "description": "List of valid groups which will have view/read privileges over the record.",
            "items": {
              "type": "string"
            }
          },
          "owners": {
            "type": "array",
            "description": "List of valid groups which will have write privileges over the record.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "RecordVersions": {
        "type": "object",
        "properties": {
          "recordId": {
            "type": "string"
          },
          "versions": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            }
          }
        },
        "description": "Storage record versions."
      },
      "PatchRecordsRequestBody": {
        "description": "Storage record metadata.",
        "type": "object",
        "required": [
          "query",
          "ops"
        ],
        "properties": {
          "query": {
            "type": "object",
            "properties": {
              "ids": {
                "type": "array",
                "items": {
                  "type": "string",
                  "example": "slb-osdu-prod-des-prod-testing:work-product-component--WellLog:a6d6-63fc9a0bbac1"
                }
              }
            },
            "description": "A list of records' unique identifiers in whole Data Platform. It indicates which records need to be updated. Record ids should follow the naming convention:{data-partition-id}:{object-type}:{uuid}.\""
          },
          "ops": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PatchOperation"
            }
          }
        },
        "example": {
          "query": {
            "ids": [
              "slb-osdu-prod-des-prod-testing:work-product-component--WellLog:a6d6-63fc9a0bbac1"
            ]
          },
          "ops": [
            {
              "op": "add",
              "path": "/acl/viewers",
              "value": [
                "data.default.viewers@slb-osdu-prod-des-prod-testing.{domain}.com"
              ]
            },
            {
              "op": "replace",
              "path": "/legal/legaltags",
              "value": [
                "slb-osdu-prod-des-prod-testing-default-legal"
              ]
            },
            {
              "op": "remove",
              "path": "/tags",
              "value": [
                "dataflowId"
              ]
            }
          ]
        }
      },
      "PatchOperation": {
        "type": "object",
        "required": [
          "op",
          "path",
          "value"
        ],
        "properties": {
          "op": {
            "type": "string",
            "description": "Bulk update record operation."
          },
          "path": {
            "type": "string",
            "description": "Bulk update record path."
          },
          "value": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Bulk update record value."
          }
        }
      },
      "BulkUpdateRecordsResponse": {
        "type": "object",
        "properties": {
          "recordCount": {
            "type": "integer",
            "format": "int32",
            "description": "Number of records updated successfully."
          },
          "recordIds": {
            "type": "array",
            "description": "List of updated record ids.",
            "items": {
              "type": "string"
            }
          },
          "notFoundRecordIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "unauthorizedRecordIds": {
            "type": "array",
            "description": "List of record ids that were not updated - user is not authorized.",
            "items": {
              "type": "string"
            }
          },
          "lockedRecordIds": {
            "type": "array",
            "description": "Records may be locked and not updated during metadata update, due to optimistic lock.",
            "items": {
              "type": "string"
            }
          }
        },
        "description": "Result of the bulk update request."
      },
      "PatchRecordsResponse": {
        "type": "object",
        "properties": {
          "recordCount": {
            "type": "integer",
            "format": "int32",
            "description": "Number of records updated successfully."
          },
          "recordIds": {
            "type": "array",
            "description": "List of updated record ids.",
            "items": {
              "type": "string"
            }
          },
          "notFoundRecordIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "failedRecordIds": {
            "type": "array",
            "description": "List of records where patch operation failed due to error.",
            "items": {
              "type": "string"
            }
          },
          "errors": {
            "type": "array",
            "description": "List of errors.",
            "items": {
              "type": "string"
            }
          }
        },
        "description": "Result of the bulk update request."
      },
      "Schema": {
        "type": "object",
        "required": [
          "kind",
          "schema"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "example": "slb-osdu-prod-des-prod-testing:wks:work-product-component--WellLog:1.0.0",
            "description": "Record kind for which the schema information is applied to."
          },
          "schema": {
            "type": "array",
            "description": "List of schema items which compose the schema.",
            "items": {
              "$ref": "#/components/schemas/SchemaItem"
            }
          },
          "ext": {
            "type": "object",
            "description": "Extension field for custom schema definition.",
            "additionalProperties": {
              "type": "object"
            }
          }
        },
        "description": "Schema definition for the specified record kind.",
        "example": {
          "kind": "slb-osdu-prod-des-prod-testing:wks:work-product-component--WellLog:1.0.0",
          "schema": [
            {
              "path": "msg",
              "kind": "string",
              "ext": {}
            },
            {
              "path": "year",
              "kind": "int",
              "ext": {}
            },
            {
              "path": "weight",
              "kind": "float",
              "ext": {}
            },
            {
              "path": "location",
              "kind": "core:dl:geopoint:1.0.0",
              "ext": {}
            },
            {
              "path": "valid",
              "kind": "bool",
              "ext": {}
            }
          ]
        }
      },
      "SchemaItem": {
        "type": "object",
        "required": [
          "kind",
          "path"
        ],
        "properties": {
          "path": {
            "type": "string",
            "description": "Schema item property name."
          },
          "kind": {
            "type": "string",
            "description": "Schema item property data type.  Allowed data types are string, int, float, double, long, boolean, link, datetime, []string, []int, []float, []double, []long, []boolean, []link, []datetime, core:dl:geopoint:1.0.0."
          },
          "ext": {
            "type": "object",
            "description": "Extension field for custom schema definition.",
            "additionalProperties": {
              "type": "object"
            }
          }
        },
        "description": "Schema item which describes schema properties and their data types."
      },
      "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."
      },
      "MultiRecordInfo": {
        "type": "object",
        "properties": {
          "records": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Record"
            }
          },
          "invalidRecords": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "retryRecords": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "MultiRecordResponse": {
        "type": "object",
        "properties": {
          "records": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "notFound": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "conversionStatuses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConversionStatus"
            }
          }
        }
      },
      "ConversionStatus": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}