{
  "openapi": "3.0.1",
  "info": {
    "title": "Notification API",
    "version": "v1",
    "x-product-id": "DrillPlan-Notification-API",
    "description": "```plain {% title=\"Client ID\" %}\nfwk-drillplan.slbservice.com\n ```\n \n"
  },
  "paths": {
    "/v1/notifications/subscriptions/types/{subscritpionType}": {
      "post": {
        "tags": [
          "Notification"
        ],
        "summary": "Create or Update a subscription. Each external source could create one subscription for a subscription type.",
        "parameters": [
          {
            "name": "subscritpionType",
            "in": "path",
            "description": "type to subscribe, supportted types are PublishData, ReviewStateChanged, PlanShared, ProjectCreated, MasterPlanChanged",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/NotificationType"
            }
          },
          {
            "$ref": "#/components/parameters/dataPartitionHeader"
          }
        ],
        "requestBody": {
          "description": "subscription",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NotificationSubscriptionBaseDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/NotificationSubscriptionBaseDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/NotificationSubscriptionBaseDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/v1/notifications/subscriptions": {
      "get": {
        "tags": [
          "Notification"
        ],
        "summary": "get subscription list subscribed by calling client",
        "parameters": [
          {
            "$ref": "#/components/parameters/dataPartitionHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NotificationSubscriptionFullDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NotificationSubscriptionFullDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NotificationSubscriptionFullDto"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/notifications/subscriptions/{subscriptionId}": {
      "delete": {
        "tags": [
          "Notification"
        ],
        "summary": "unscribe a notifcation by subscription Id",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/dataPartitionHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "dataPartitionHeader": {
        "name": "slb-partition-id",
        "in": "header",
        "description": "The data partition id.",
        "required": true,
        "schema": {
          "type": "string"
        }
      }
    },
    "schemas": {
      "NotificationSubscriptionBaseDto": {
        "required": [
          "callback_uri",
          "subscriber"
        ],
        "type": "object",
        "properties": {
          "subscriber": {
            "type": "string",
            "description": "readable name for client who create the subscription, just for display."
          },
          "data_source": {
            "type": "string",
            "description": "data source for subscription, only for publish data subscription type.",
            "nullable": true
          },
          "callback_uri": {
            "type": "string",
            "description": "callback uri when notification published, the URI should accept a POST method, as we need publish notification content as playload",
            "format": "uri"
          },
          "callback_headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Header to call the callback_uri, information provided could be authentication information.\r\nFor example:\r\n{\"Authorization\": \"Bearer *****\"}\r\nor {\"Authorization\": \"Basic ******\"}\r\nor {\"appkey\": \"some key\"}",
            "nullable": true,
            "example": {
              "Authorization": "Bearer some_token"
            }
          },
          "drill_plan_object_types": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "List of objects the subscription interested in. object type supportted:\r\n/well/api/wells <br />\r\n/customParameters/api/custom-parameters  <br />\r\n/location/api/surface-locations  <br />\r\n/well/api/wellbores  <br />\r\n/WellheadAndBop/wellhead-and-bops  <br />\r\n/WellBarrier/api/data/v1/well-barriers  <br />\r\n/ghg-emissions-footprint/api/configurations  <br />\r\n/WellMontage/api/well-montages  <br />\r\n/geology/api/formation-tops  <br />\r\n/geomechanics/api/mwws  <br /> \r\n/geomechanics/api/temperatures  <br />\r\n/location/api/targets  <br />\r\n/Rig/api/rigsets  <br />\r\n/Traj/api/trajectories  <br />\r\n/well/api/wbgs  <br />\r\n/ComposerReverseProxy/SidetrackPoint/api/sidetrack-points  <br />\r\n/risks/api/risk-sets  <br />\r\n/composer/api/cs/activity-plans  <br />\r\n/afe/api/cs/afes  <br />\r\n/CasingDesign/casing-designs  <br />\r\n/olga-thermal/olga-thermals  <br />\r\n/KickTolerance/api/kick-tolerance-criteria  <br />\r\n/dynamic-well-control/api/configurations  <br />\r\n/TaskManager/api/v1/corporate-deliverables  <br />\r\n/well/api/sections  <br />\r\n/Schedule/api/l2-activities  <br />\r\n/Schedule/api/l3-activities  <br />\r\n/Schedule/api/l3-complete-wells  <br />\r\n/cementing/api/cementing  <br />\r\n/cementing/api/tieback-cementing  <br />\r\n/cementing/api/digital-cement-plan  <br />\r\n/casing/api/casings  <br />\r\n/casing/api/liners  <br />\r\n/casing/api/tiebacks  <br />\r\n/completionfluid/api/completion-fluids  <br />\r\n/drillingfluid/api/drilling-fluid-programs  <br />\r\n/evaluation/api/v1/cits  <br />\r\n/evaluation/api/v1/evaluations  <br />\r\n/Schedule/api/l5-activities  <br />\r\n/Schedule/api/l5-completion-runs  <br />\r\n/Completion/completion-integrity  <br />\r\n/Schedule/api/l5-casing-runs  <br />\r\n/Schedule/api/l5-casing-drilling-runs  <br />\r\n/Schedule/api/runs  <br />\r\n/OperationParameter/api/casing-operation-parameter-sets  <br />\r\n/OperationParameter/api/liner-operation-parameter-sets  <br />\r\n/OperationParameter/api/tieback-operation-parameter-sets  <br />\r\n/Completion/completion-string  <br />\r\n/OperationParameter/api/operation-parameter-sets  <br />\r\n/BhaBuilder/api/bhas  <br />\r\n/BhaBuilder/api/mud-pulse-telemetry-parameter  <br />\r\n/zone/api/zones <br />\r\n/well/api/wellbore-completions  <br />\r\n/completionplan/api/completion-plans  <br />\r\nreporting",
            "nullable": true
          },
          "contact_email": {
            "type": "string",
            "format": "email",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "NotificationSubscriptionFullDto": {
        "required": [
          "callback_uri",
          "subscriber"
        ],
        "type": "object",
        "properties": {
          "subscriber": {
            "type": "string",
            "description": "readable name for client who create the subscription, just for display."
          },
          "data_source": {
            "type": "string",
            "description": "data source for subscription, only for publish data subscription type.",
            "nullable": true
          },
          "callback_uri": {
            "type": "string",
            "description": "callback uri when notification published, the URI should accept a POST method, as we need publish notification content as playload",
            "format": "uri"
          },
          "callback_headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Header to call the callback_uri, information provided could be authentication information.\r\nFor example:\r\n{\"Authorization\": \"Bearer *****\"}\r\nor {\"Authorization\": \"Basic ******\"}\r\nor {\"appkey\": \"some key\"}",
            "nullable": true
          },
          "drill_plan_object_types": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "List of objects the subscription interested in. object type supportted:\r\n/well/api/wells <br />\r\n/customParameters/api/custom-parameters  <br />\r\n/location/api/surface-locations  <br />\r\n/well/api/wellbores  <br />\r\n/WellheadAndBop/wellhead-and-bops  <br />\r\n/WellBarrier/api/data/v1/well-barriers  <br />\r\n/ghg-emissions-footprint/api/configurations  <br />\r\n/WellMontage/api/well-montages  <br />\r\n/geology/api/formation-tops  <br />\r\n/geomechanics/api/mwws  <br /> \r\n/geomechanics/api/temperatures  <br />\r\n/location/api/targets  <br />\r\n/Rig/api/rigsets  <br />\r\n/Traj/api/trajectories  <br />\r\n/well/api/wbgs  <br />\r\n/ComposerReverseProxy/SidetrackPoint/api/sidetrack-points  <br />\r\n/risks/api/risk-sets  <br />\r\n/composer/api/cs/activity-plans  <br />\r\n/afe/api/cs/afes  <br />\r\n/CasingDesign/casing-designs  <br />\r\n/olga-thermal/olga-thermals  <br />\r\n/KickTolerance/api/kick-tolerance-criteria  <br />\r\n/dynamic-well-control/api/configurations  <br />\r\n/TaskManager/api/v1/corporate-deliverables  <br />\r\n/well/api/sections  <br />\r\n/Schedule/api/l2-activities  <br />\r\n/Schedule/api/l3-activities  <br />\r\n/Schedule/api/l3-complete-wells  <br />\r\n/cementing/api/cementing  <br />\r\n/cementing/api/tieback-cementing  <br />\r\n/cementing/api/digital-cement-plan  <br />\r\n/casing/api/casings  <br />\r\n/casing/api/liners  <br />\r\n/casing/api/tiebacks  <br />\r\n/completionfluid/api/completion-fluids  <br />\r\n/drillingfluid/api/drilling-fluid-programs  <br />\r\n/evaluation/api/v1/cits  <br />\r\n/evaluation/api/v1/evaluations  <br />\r\n/Schedule/api/l5-activities  <br />\r\n/Schedule/api/l5-completion-runs  <br />\r\n/Completion/completion-integrity  <br />\r\n/Schedule/api/l5-casing-runs  <br />\r\n/Schedule/api/l5-casing-drilling-runs  <br />\r\n/Schedule/api/runs  <br />\r\n/OperationParameter/api/casing-operation-parameter-sets  <br />\r\n/OperationParameter/api/liner-operation-parameter-sets  <br />\r\n/OperationParameter/api/tieback-operation-parameter-sets  <br />\r\n/Completion/completion-string  <br />\r\n/OperationParameter/api/operation-parameter-sets  <br />\r\n/BhaBuilder/api/bhas  <br />\r\n/BhaBuilder/api/mud-pulse-telemetry-parameter  <br />\r\n/zone/api/zones <br />\r\n/well/api/wellbore-completions  <br />\r\n/completionplan/api/completion-plans  <br />\r\nreporting",
            "nullable": true
          },
          "contact_email": {
            "type": "string",
            "format": "email",
            "nullable": true
          },
          "subscription_id": {
            "type": "string",
            "description": "id used to unsubscription",
            "nullable": true
          },
          "client_id": {
            "type": "string",
            "description": "client id to create this subscription",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "subscription_type": {
            "$ref": "#/components/schemas/NotificationType"
          }
        },
        "additionalProperties": false
      },
      "NotificationType": {
        "enum": [
          "PublishData",
          "ReviewStateChanged",
          "PlanShared",
          "ProjectCreated",
          "MasterPlanChanged"
        ],
        "type": "string"
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "User Token from SLB Authenticator Service"
      },
      "appkey": {
        "type": "apiKey",
        "description": "AppKey/ConsumerKey from your App on Developer Portal",
        "name": "appkey",
        "in": "header"
      },
      "sauth_service_token": {
        "type": "oauth2",
        "description": "Service from SAuth v2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://p4d.csi.cloud.slb-ds.com/v2/token",
            "scopes": {
              "fwk-drillplan.slbservice.com": ""
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "bearer": [],
      "appkey": []
    },
    {
      "sauth_service_token": [],
      "appkey": []
    }
  ],
  "servers": [
    {
      "url": "https://eu-api.delfi.slb.com/drillplan/notifications",
      "description": "ProdEU"
    },
    {
      "url": "https://api.delfi.slb.com/drillplan/notifications",
      "description": "ProdUS"
    }
  ]
}