{
  "openapi": "3.1.0",
  "info": {
    "title": "Ophiolite scientific asset pilot API",
    "version": "1",
    "description": "M2 exact scientific reads. Browser uses CSRF-protected POST aliases to the same service."
  },
  "paths": {
    "/api/v1/projects/{project}/scientific-assets": {
      "get": {
        "description": "Permission-filtered bounded discovery",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "scopedBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "next_cursor"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "maxItems": 100,
                      "items": {
                        "$ref": "./summary-schema.json"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Versioned error; see README",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Busy: retry the same exact request after Retry-After",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/scientific-assets/{asset}/revisions/{revision}": {
      "get": {
        "description": "Exact descriptor without creating a run",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "asset",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "revision",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "curve",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Required for descriptor and curve:<mnemonic>; artifact is independent of curve."
          }
        ],
        "security": [
          {
            "scopedBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "./schema.json"
                }
              }
            }
          },
          "default": {
            "description": "Versioned error; see README",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Busy: retry the same exact request after Retry-After",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{project}/scientific-assets/{asset}/revisions/{revision}/representations/{representation}": {
      "get": {
        "description": "Exact bounded representation bytes",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "asset",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "revision",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "representation",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "curve",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for descriptor and curve:<mnemonic>; artifact is independent of curve."
          }
        ],
        "security": [
          {
            "scopedBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized result",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "default": {
            "description": "Versioned error; see README",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Busy: retry the same exact request after Retry-After",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "scopedBearer": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error",
          "code"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "code": {
            "type": "string"
          }
        }
      }
    }
  }
}
