{
  "openapi": "3.0.1",
  "info": {
    "title": "Nuxed.Api | v1",
    "version": "1.0.0"
  },
  "paths": {
    "/": {
      "get": {
        "tags": [
          "Nuxed.Api"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/access/session": {
      "post": {
        "tags": [
          "Access"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccessSessionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AccessSessionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AccessSessionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AccessSessionResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessSessionResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessSessionResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/communities": {
      "get": {
        "tags": [
          "Communities"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CommunitySummaryResponse"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CommunitySummaryResponse"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CommunitySummaryResponse"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/communities/{slug}/dashboard": {
      "get": {
        "tags": [
          "Communities"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CommunityDashboardResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommunityDashboardResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommunityDashboardResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/invitations": {
      "get": {
        "tags": [
          "Invitations"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InvitationResponse"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InvitationResponse"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InvitationResponse"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Invitations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvitationRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvitationRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvitationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/invitations/{id}": {
      "get": {
        "tags": [
          "Invitations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/memberships": {
      "get": {
        "tags": [
          "Memberships"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MembershipResponse"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MembershipResponse"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MembershipResponse"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/memberships/{id}/approve": {
      "post": {
        "tags": [
          "Memberships"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApproveMembershipRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ApproveMembershipRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ApproveMembershipRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/system": {
      "get": {
        "tags": [
          "System"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiInfoResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiInfoResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiInfoResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AccessibleCommunityResponse": {
        "required": [
          "membershipId",
          "communityId",
          "name",
          "slug",
          "type",
          "languageCode",
          "role",
          "status",
          "description",
          "approvedMemberCount"
        ],
        "type": "object",
        "properties": {
          "membershipId": {
            "type": "string",
            "format": "uuid"
          },
          "communityId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "languageCode": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "approvedMemberCount": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "AccessSessionRequest": {
        "required": [
          "email"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "invitationToken": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "AccessSessionResponse": {
        "required": [
          "email",
          "accessState",
          "userStatus",
          "message",
          "communities"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "accessState": {
            "type": "string"
          },
          "userStatus": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "communities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccessibleCommunityResponse"
            }
          }
        }
      },
      "ApiInfoResponse": {
        "required": [
          "name",
          "version",
          "environment",
          "documentationUrl",
          "capabilities"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "environment": {
            "type": "string"
          },
          "documentationUrl": {
            "type": "string"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ApproveMembershipRequest": {
        "type": "object",
        "properties": {
          "approvedByUserId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          }
        },
        "nullable": true
      },
      "CommunityDashboardCapsuleResponse": {
        "required": [
          "title",
          "tag",
          "summary"
        ],
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "tag": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          }
        }
      },
      "CommunityDashboardResponse": {
        "required": [
          "communityName",
          "description",
          "workspaceType",
          "languageCode",
          "alert",
          "assistantDraft",
          "capsules",
          "tasks",
          "timeline"
        ],
        "type": "object",
        "properties": {
          "communityName": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "workspaceType": {
            "type": "string"
          },
          "languageCode": {
            "type": "string"
          },
          "alert": {
            "type": "string"
          },
          "assistantDraft": {
            "type": "string"
          },
          "capsules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommunityDashboardCapsuleResponse"
            }
          },
          "tasks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommunityDashboardTaskResponse"
            }
          },
          "timeline": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CommunityDashboardTaskResponse": {
        "required": [
          "title",
          "owner",
          "due"
        ],
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "owner": {
            "type": "string"
          },
          "due": {
            "type": "string"
          }
        }
      },
      "CommunitySummaryResponse": {
        "required": [
          "id",
          "name",
          "slug",
          "type",
          "languageCode",
          "status",
          "description",
          "ownerDisplayName",
          "approvedMemberCount"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "languageCode": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "ownerDisplayName": {
            "type": "string"
          },
          "approvedMemberCount": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "CreateInvitationRequest": {
        "required": [
          "email",
          "communityId",
          "defaultRole"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "communityId": {
            "type": "string",
            "format": "uuid"
          },
          "invitedByUserId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "defaultRole": {
            "$ref": "#/components/schemas/MembershipRole"
          },
          "expiresInDays": {
            "maximum": 30,
            "minimum": 1,
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "InvitationResponse": {
        "required": [
          "id",
          "email",
          "communityId",
          "communityName",
          "invitedByUserId",
          "invitedByDisplayName",
          "defaultRole",
          "status",
          "expiresAt",
          "createdAt",
          "token"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "email": {
            "type": "string"
          },
          "communityId": {
            "type": "string",
            "format": "uuid"
          },
          "communityName": {
            "type": "string"
          },
          "invitedByUserId": {
            "type": "string",
            "format": "uuid"
          },
          "invitedByDisplayName": {
            "type": "string"
          },
          "defaultRole": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "token": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "MembershipResponse": {
        "required": [
          "membershipId",
          "userId",
          "userEmail",
          "communityId",
          "communityName",
          "role",
          "status",
          "createdAt",
          "approvedAt",
          "approvedByUserId"
        ],
        "type": "object",
        "properties": {
          "membershipId": {
            "type": "string",
            "format": "uuid"
          },
          "userId": {
            "type": "string",
            "format": "uuid"
          },
          "userEmail": {
            "type": "string"
          },
          "communityId": {
            "type": "string",
            "format": "uuid"
          },
          "communityName": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "approvedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "approvedByUserId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          }
        }
      },
      "MembershipRole": {
        "type": "integer"
      }
    }
  },
  "tags": [
    {
      "name": "Nuxed.Api"
    },
    {
      "name": "Access"
    },
    {
      "name": "Communities"
    },
    {
      "name": "Invitations"
    },
    {
      "name": "Memberships"
    },
    {
      "name": "System"
    }
  ]
}