{
  "openapi": "3.0.1",
  "info": {
    "title": "Project Plan API",
    "version": "1.0.0.0",
    "x-product-id": "Public-Digital-Plan-API",
    "description": "Provides access to DrillPlan project plan entities.\n```plain {% title=\"Client ID\" %}\nfwk-drillplan.slbservice.com\n```\n"
  },
  "tags": [
    {
      "name": "Plan",
      "description": "Service endpoints to access DrillPlan plans."
    },
    {
      "name": "Project",
      "description": "Service endpoints to access DrillPlan projects."
    }
  ],
  "security": [
    {
      "bearer": [],
      "appkey": []
    }
  ],
  "paths": {
    "/plans/by-project/{projectId}": {
      "get": {
        "tags": [
          "Plan"
        ],
        "summary": "Get plan list for given project by projectId",
        "description": "Get plan list for given project by projectId",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "The DrillPlan project id. In a DrillPlan project, you can define well data, design tasks for drilling, analyze drilling risks, create an operational activity plan, prepare for the AFE estimation, and generate a drilling program report for a well plan.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/dataPartitionHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicPlanDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleResponse"
                }
              }
            }
          }
        }
      }
    },
    "/plans/{planId}/artifact-index": {
      "get": {
        "tags": [
          "Plan"
        ],
        "summary": "Get artifact index for given plan by planId",
        "description": "Get artifact index for given plan by planId",
        "parameters": [
          {
            "name": "planId",
            "in": "path",
            "description": "The DrillPlan project plan id. A DrillPlan project can have multiple plans, but you can only set one of them as the master plan. The master plan is the main plan that the team is working on. Other plans can be concept evaluations, contingency plans, or similar.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/dataPartitionHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtifactIndexDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleResponse"
                }
              }
            }
          }
        }
      }
    },
    "/plans/{planId}/artifacts/{id}/{artifactType}": {
      "get": {
        "tags": [
          "Plan"
        ],
        "summary": "Get a specific artifact",
        "description": "Get a specific artifact",
        "parameters": [
          {
            "name": "planId",
            "in": "path",
            "description": "The DrillPlan project plan id. A DrillPlan project can have multiple plans, but you can only set one of them as the master plan. The master plan is the main plan that the team is working on. Other plans can be concept evaluations, contingency plans, or similar.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "The artifact id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "artifactType",
            "in": "path",
            "description": "The artifact type.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Accept-Language",
            "in": "header",
            "description": "The Accept-Language header to specify the language for the response.",
            "required": false,
            "schema": {
              "type": "string",
              "default": "en-US"
            }
          },
          {
            "$ref": "#/components/parameters/dataPartitionHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicProjectSummaryDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleResponse"
                }
              }
            }
          }
        }
      }
    },
    "/attachments/{attachmentId}": {
      "get": {
        "tags": [
          "Plan"
        ],
        "summary": "[Experimental] Download an attachment. This API is not intended to be called with custom inputs. Please use the download links in artifact index.",
        "parameters": [
          {
            "$ref": "#/components/parameters/dataPartitionHeader"
          },
          {
            "name": "attachmentId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    },
    "/projects/joined": {
      "get": {
        "tags": [
          "Project"
        ],
        "summary": "Get user joined project list",
        "description": "Get user joined project list",
        "parameters": [
          {
            "$ref": "#/components/parameters/dataPartitionHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicJoinedProjectSummaryDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleResponse"
                }
              }
            }
          }
        }
      }
    },
    "/projects/pages": {
      "get": {
        "tags": [
          "Project"
        ],
        "summary": "Query paginated DrillPlan projects",
        "description": "Query all DrillPlan projects and get paginated result",
        "parameters": [
          {
            "$ref": "#/components/parameters/dataPartitionHeader"
          },
          {
            "name": "page_index",
            "in": "query",
            "description": "page index starts from 1",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "required": true
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "number of projects per page",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 100
            },
            "required": true
          },
          {
            "name": "q",
            "in": "query",
            "description": "search text on well_name or client_name",
            "schema": {
              "type": "string",
              "nullable": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicProjectsByPageDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleResponse"
                }
              }
            }
          }
        }
      }
    },
    "/projects/{projectId}": {
      "get": {
        "tags": [
          "Project"
        ],
        "summary": "Get DrillPlan project by id",
        "description": "Get DrillPlan project by id",
        "parameters": [
          {
            "$ref": "#/components/parameters/dataPartitionHeader"
          },
          {
            "name": "projectId",
            "in": "path",
            "description": "The DrillPlan project id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicProjectDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleResponse"
                }
              }
            }
          }
        }
      }
    },
    "/plans/{planId}/application-links": {
      "get": {
        "tags": [
          "Plan"
        ],
        "summary": "Get DrillPlan application links (e.g. DrillPlan editor links)",
        "parameters": [
          {
            "name": "planId",
            "in": "path",
            "description": "The plan id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/dataPartitionHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EditorInfo"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EditorInfo"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EditorInfo"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleResponse"
                }
              }
            }
          }
        }
      }
    },
    "/plans/{planId}/application-review-states": {
      "get": {
        "tags": [
          "Plan"
        ],
        "summary": "Get DrillPlan application review states",
        "parameters": [
          {
            "name": "planId",
            "in": "path",
            "description": "The plan id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/dataPartitionHeader"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApplicationReviewState"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApplicationReviewState"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApplicationReviewState"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "dataPartitionHeader": {
        "name": "slb-data-partition-id",
        "in": "header",
        "description": "The data partition id.",
        "required": true,
        "schema": {
          "type": "string"
        }
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "User Token from SLB Authenticator Service"
      },
      "appkey": {
        "type": "apiKey",
        "name": "appkey",
        "in": "header"
      }
    },
    "schemas": {
      "ArtifactIndexDto": {
        "type": "object",
        "properties": {
          "plan_name": {
            "type": "string",
            "nullable": true
          },
          "plan_status": {
            "$ref": "#/components/schemas/PlanStatus"
          },
          "data_partition_id": {
            "type": "string",
            "nullable": true
          },
          "last_update_time": {
            "type": "string",
            "format": "date-time"
          },
          "well": {
            "$ref": "#/components/schemas/ArtifactIndexScopeObject"
          },
          "wellbores": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArtifactIndexWellboreInfo"
            },
            "nullable": true
          },
          "sections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArtifactIndexSectionInfo"
            },
            "nullable": true
          },
          "runs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArtifactIndexRunInfo"
            },
            "nullable": true
          },
          "artifacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArtifactIndexItem"
            },
            "nullable": true
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AttachmentIndexItem"
            },
            "description": "The attachments table, which you can filter by artifact type.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ArtifactIndexItem": {
        "type": "object",
        "properties": {
          "wellbore_id": {
            "type": "string",
            "nullable": true
          },
          "section_id": {
            "type": "string",
            "nullable": true
          },
          "run_id": {
            "type": "string",
            "nullable": true
          },
          "node_id": {
            "type": "string",
            "nullable": true
          },
          "artifact_type": {
            "type": "string",
            "nullable": true
          },
          "artifact_link": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ArtifactIndexRunInfo": {
        "type": "object",
        "properties": {
          "display_name": {
            "type": "string",
            "nullable": true
          },
          "id": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "section_id": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ArtifactIndexScopeObject": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "id": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ArtifactIndexSectionInfo": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "id": {
            "type": "string",
            "nullable": true
          },
          "wellbore_id": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ArtifactIndexWellboreInfo": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "id": {
            "type": "string",
            "nullable": true
          },
          "parent_wellbore": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "AttachmentIndexItem": {
        "type": "object",
        "properties": {
          "node_id": {
            "type": "string",
            "nullable": true
          },
          "attachment_download_link": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PlanStatus": {
        "enum": [
          "Working"
        ],
        "type": "string"
      },
      "PublicPlanDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "is_master": {
            "type": "boolean"
          },
          "status": {
            "$ref": "#/components/schemas/PlanStatus"
          },
          "share_time": {
            "type": "string",
            "format": "date-time"
          },
          "share_by": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PublicJoinedProjectSummaryDto": {
        "type": "object",
        "properties": {
          "project_id": {
            "type": "string"
          },
          "project_name": {
            "type": "string"
          },
          "main_well_id": {
            "type": "string"
          },
          "well_name": {
            "type": "string"
          },
          "client_name": {
            "type": "string"
          },
          "country": {
            "type": "string",
            "nullable": true
          },
          "coordinate_reference_system": {
            "type": "string",
            "nullable": true
          },
          "created_by": {
            "type": "string",
            "nullable": true
          },
          "create_date": {
            "type": "string",
            "nullable": true
          },
          "language": {
            "type": "string"
          },
          "main_uwi": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PublicProjectSummaryDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PublicJoinedProjectSummaryDto"
          },
          {
            "type": "object",
            "properties": {
              "is_invitation_only": {
                "type": "boolean"
              },
              "joined": {
                "type": "boolean"
              }
            }
          }
        ],
        "additionalProperties": false
      },
      "PublicProjectsByPageDto": {
        "type": "object",
        "properties": {
          "projects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicProjectSummaryDto"
            }
          },
          "page_index": {
            "type": "integer"
          },
          "total_pages": {
            "type": "integer"
          },
          "total_items": {
            "type": "integer"
          }
        },
        "additionalProperties": false
      },
      "SimpleResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        }
      },
      "PublicProjectDto": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PublicProjectSummaryDto"
          },
          {
            "type": "object",
            "properties": {
              "corporate_profile_id": {
                "type": "string"
              },
              "corporate_profile_name": {
                "type": "string",
                "description": "The name of the corporate profile defined inside corporate settings."
              }
            }
          }
        ],
        "additionalProperties": true
      },
      "EditorInfo": {
        "type": "object",
        "properties": {
          "node_id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "wellbore_id": {
            "type": "string",
            "nullable": true
          },
          "section_id": {
            "type": "string",
            "nullable": true
          },
          "run_id": {
            "type": "string",
            "nullable": true
          },
          "node_type": {
            "type": "string",
            "nullable": true
          },
          "editor_link": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "DrillPlan editor info including direct link to open the corresponding editor"
      },
      "ApplicationReviewState": {
        "type": "object",
        "properties": {
          "node_id": {
            "type": "string",
            "description": "The unique identifier of the node."
          },
          "node_type": {
            "type": "string",
            "description": "The type of the node."
          },
          "name": {
            "type": "string",
            "description": "The name of the node."
          },
          "review_state": {
            "$ref": "#/components/schemas/ReviewState"
          }
        },
        "required": [
          "node_id",
          "node_type",
          "name",
          "review_state"
        ]
      },
      "ReviewState": {
        "type": "string",
        "description": "The current review state of the node.",
        "enum": [
          "InProgress",
          "InReview",
          "InApproval",
          "Completed",
          "Rejected"
        ]
      }
    }
  },
  "servers": [
    {
      "url": "https://eu-api.delfi.slb.com/drillplan/plan/v1",
      "description": "ProdEU"
    },
    {
      "url": "https://api.delfi.slb.com/drillplan/plan/v1",
      "description": "ProdUS"
    }
  ]
}