{
  "openapi": "3.0.3",
  "info": {
    "title": "Northstar Developer API",
    "version": "1.0.0",
    "description": "A complete fictional collaboration interface. Explore a workspace contract, reviewed request/response examples and portable integration files."
  },
  "servers": [
    {
      "url": "https://api.northstar.example/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "schemas": {
      "Workspace": {
        "type": "object",
        "required": [
          "id",
          "name",
          "plan",
          "members"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "plan": {
            "type": "string",
            "enum": [
              "starter",
              "team"
            ]
          },
          "members": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "paths": {
    "/workspaces": {
      "get": {
        "operationId": "listWorkspaces",
        "summary": "List your team workspaces",
        "description": "Returns a bounded list of the caller’s accessible workspaces. This fictional contract uses a limit and optional plan filter.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum records in this response.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            },
            "example": 12
          },
          {
            "name": "plan",
            "in": "query",
            "description": "Filter by subscription plan.",
            "schema": {
              "type": "string",
              "enum": [
                "starter",
                "team"
              ]
            },
            "example": "team"
          }
        ],
        "responses": {
          "200": {
            "description": "Workspace list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "total"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Workspace"
                      }
                    },
                    "total": {
                      "type": "integer",
                      "minimum": 0
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "wk_river_01",
                      "name": "River Launch",
                      "plan": "team",
                      "members": 4
                    }
                  ],
                  "total": 1
                }
              }
            }
          },
          "401": {
            "description": "Authentication is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Provide an active API token."
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createWorkspace",
        "summary": "Create a named workspace",
        "description": "Creates one workspace for the caller. This is a mutating request example; the reference never executes it.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "plan"
                ],
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "plan": {
                    "type": "string",
                    "enum": [
                      "starter",
                      "team"
                    ]
                  }
                }
              },
              "example": {
                "name": "River Launch",
                "plan": "team"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Workspace created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                },
                "example": {
                  "id": "wk_river_01",
                  "name": "River Launch",
                  "plan": "team",
                  "members": 4
                }
              }
            }
          },
          "401": {
            "description": "Authentication is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Provide an active API token."
                  }
                }
              }
            }
          },
          "422": {
            "description": "Input does not satisfy the workspace contract.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid-name",
                    "message": "Provide a nonempty name of at most 80 characters."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/workspaces/{workspaceId}": {
      "parameters": [
        {
          "name": "workspaceId",
          "in": "path",
          "required": true,
          "description": "The workspace identifier from the list response.",
          "schema": {
            "type": "string",
            "minLength": 1
          },
          "example": "wk_river_01"
        }
      ],
      "get": {
        "operationId": "getWorkspace",
        "summary": "Inspect a workspace",
        "description": "Read its name, plan and member count. Private access is determined by the actual service, outside this documentation generator.",
        "responses": {
          "200": {
            "description": "Workspace details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                },
                "example": {
                  "id": "wk_river_01",
                  "name": "River Launch",
                  "plan": "team",
                  "members": 4
                }
              }
            }
          },
          "401": {
            "description": "Authentication is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Provide an active API token."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The workspace was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not-found",
                    "message": "Check the workspace ID."
                  }
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateWorkspace",
        "summary": "Rename a workspace",
        "description": "Updates the workspace name. Review permissions and the intended mutation before running a downloaded example.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  }
                }
              },
              "example": {
                "name": "River Launch / Review"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                },
                "example": {
                  "id": "wk_river_01",
                  "name": "River Launch / Review",
                  "plan": "team",
                  "members": 4
                }
              }
            }
          },
          "401": {
            "description": "Authentication is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Provide an active API token."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The workspace was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not-found",
                    "message": "Check the workspace ID."
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteWorkspace",
        "summary": "Remove a workspace",
        "description": "A destructive request example requiring an explicit decision in the real service. No deletion occurs in this studio.",
        "responses": {
          "204": {
            "description": "Removed; no response body."
          },
          "401": {
            "description": "Authentication is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Provide an active API token."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The workspace was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not-found",
                    "message": "Check the workspace ID."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/workspaces/{workspaceId}/activity": {
      "parameters": [
        {
          "name": "workspaceId",
          "in": "path",
          "required": true,
          "description": "The workspace identifier from the list response.",
          "schema": {
            "type": "string",
            "minLength": 1
          },
          "example": "wk_river_01"
        }
      ],
      "get": {
        "operationId": "listActivity",
        "summary": "Read recent activity",
        "description": "Returns authored workspace activity records from this fictional interface.",
        "responses": {
          "200": {
            "description": "Recent activity.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "kind",
                          "message"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "created",
                              "reviewed",
                              "shared"
                            ]
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "items": [
                    {
                      "id": "ev_01",
                      "kind": "created",
                      "message": "First review brief added."
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Authentication is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Provide an active API token."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The workspace was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not-found",
                    "message": "Check the workspace ID."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Check service health",
        "description": "A public health contract with a simple status response.",
        "security": [],
        "responses": {
          "200": {
            "description": "Service health.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok"
                      ]
                    }
                  }
                },
                "example": {
                  "status": "ok"
                }
              }
            }
          }
        }
      }
    }
  }
}
