openapi: 3.1.0
info:
  title: JarDrop API
  description: |
    Venue feedback platform API.

    JarDrop provides QR code-based surveys with AI-powered sentiment analysis for service venues.

    ## Architecture

    JarDrop uses a **Supabase RPC-first architecture**. All API endpoints are PostgreSQL functions
    called via Supabase's REST API. The base URL for RPC calls is:

    ```
    POST {SUPABASE_URL}/rest/v1/rpc/{function_name}
    ```

    ## Authentication

    - **Public endpoints**: No authentication required (anonymous access)
    - **Authenticated endpoints**: Require a valid JWT token in the `Authorization` header

    ```
    Authorization: Bearer {your_jwt_token}
    ```

    JWT tokens are obtained via Supabase Auth (sign in/sign up flows).

    ## Rate Limiting

    - Public feedback submission: 1 request per 30 seconds per client
    - Authenticated endpoints: Standard Supabase rate limits apply

    ## Getting Started

    ### 1. Get your API credentials

    You'll need two things from your Supabase project:
    - **Project URL**: `https://your-project.supabase.co`
    - **Anon Key**: Your public anonymous key (safe to use in client-side code)

    ### 2. Make your first request

    ```bash
    # List public templates (no auth required)
    curl -X POST 'https://dwxmozusznmzykqvffct.supabase.co/rest/v1/rpc/get_public_templates' \
      -H 'apikey: YOUR_ANON_KEY' \
      -H 'Content-Type: application/json' \
      -d '{}'
    ```

    ### 3. Authenticate for protected endpoints

    ```bash
    # Sign in to get a JWT token
    curl -X POST 'https://dwxmozusznmzykqvffct.supabase.co/auth/v1/token?grant_type=password' \
      -H 'apikey: YOUR_ANON_KEY' \
      -H 'Content-Type: application/json' \
      -d '{"email": "user@example.com", "password": "your-password"}'

    # Use the access_token in subsequent requests
    curl -X POST 'https://dwxmozusznmzykqvffct.supabase.co/rest/v1/rpc/list_company_forms' \
      -H 'apikey: YOUR_ANON_KEY' \
      -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
      -H 'Content-Type: application/json' \
      -d '{"p_company_id": "your-org-uuid"}'
    ```

    ## SDK Support

    We recommend using the official Supabase client libraries:
    - **JavaScript**: `@supabase/supabase-js`
    - **Python**: `supabase-py`
    - **Dart/Flutter**: `supabase_flutter`

    ```typescript
    import { createClient } from '@supabase/supabase-js'

    const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY)

    // Call RPC functions
    const { data, error } = await supabase.rpc('get_public_templates', {
      p_category: 'restaurant',
      p_language: 'en'
    })
    ```

  version: 1.0.0
  contact:
    name: JarDrop Support
    url: https://www.jardrop.com
    email: support@jardrop.com
  license:
    name: Proprietary
    url: https://www.jardrop.com/terms

servers:
  - url: https://dwxmozusznmzykqvffct.supabase.co/rest/v1
    description: Production Supabase API
  - url: http://localhost:54321/rest/v1
    description: Local Supabase (development)

externalDocs:
  description: JarDrop API Documentation Portal
  url: https://api.jardrop.com

tags:
  - name: Forms
    description: |
      Form management endpoints for creating, listing, and updating feedback forms.
      Forms are the primary way restaurants collect guest feedback via QR codes.
  - name: Feedback
    description: |
      Feedback submission and management. Includes public submission (anonymous guests)
      and authenticated management (restaurant owners).
  - name: Templates
    description: |
      Pre-built survey templates in 6 languages (EN, SV, DE, FR, IT, NL).
      Templates provide ready-to-use question sets for different use cases.
  - name: Surveys
    description: |
      Multi-location survey management. Surveys can be assigned to multiple locations,
      each with a unique QR code token.
  - name: Validation
    description: |
      Input validation and configuration endpoints for organization setup and customization.
  - name: Customization
    description: |
      Organization customization and theming endpoints.
  - name: Webhooks
    description: |
      Edge function webhooks triggered by database events.
      These are internal endpoints but documented for transparency.

      **Available Webhooks**:
      - `send-feedback-notification` - Triggered on new feedback
      - `send-welcome-email` - Triggered on new user signup
      - `generate-weekly-digest` - Scheduled every Sunday 9am UTC
      - `notify-admin-new-signup` - Admin notification on signups

paths:
  /rpc/get_form_by_identifier:
    post:
      tags:
        - Forms
      summary: Get form by identifier
      description: |
        Retrieves a form and its associated organization details by the form's public identifier.
        Used when rendering the public feedback page for QR code scans.

        **Access**: Public (anonymous)
      operationId: getFormByIdentifier
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - form_identifier
              properties:
                form_identifier:
                  type: string
                  description: The 8-12 character alphanumeric form identifier
                  example: "abc123xyz"
                  minLength: 8
                  maxLength: 12
      responses:
        '200':
          description: Form found successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  identifier:
                    type: string
                  name:
                    type: string
                  welcome_message:
                    type: string
                    nullable: true
                  is_active:
                    type: boolean
                  organization:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      name:
                        type: string
                      logo_url:
                        type: string
                        nullable: true
        '404':
          description: Form not found or inactive

  /rpc/create_form:
    post:
      tags:
        - Forms
      summary: Create a new form
      description: |
        Creates a new feedback form for an organization. Automatically generates
        a unique 8-12 character alphanumeric identifier for QR codes.

        **Access**: Authenticated (organization owner/member)
      operationId: createForm
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - p_company_id
                - p_name
              properties:
                p_company_id:
                  type: string
                  format: uuid
                  description: Organization UUID
                p_name:
                  type: string
                  description: Form name (internal use)
                  maxLength: 255
                  example: "Main Dining Feedback"
                p_welcome_message:
                  type: string
                  description: Optional welcome message shown to guests
                  maxLength: 500
                  nullable: true
                  example: "We'd love to hear about your experience!"
      responses:
        '200':
          description: Form created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  form_id:
                    type: string
                    format: uuid
                  identifier:
                    type: string
                    description: Generated form identifier for QR codes
                    example: "abc123xyz"
        '401':
          description: Unauthorized - invalid or missing JWT token
        '403':
          description: Forbidden - user does not have access to this organization

  /rpc/list_company_forms:
    post:
      tags:
        - Forms
      summary: List organization forms
      description: |
        Lists all forms for an organization with feedback counts.

        **Access**: Authenticated (organization owner/member)
      operationId: listCompanyForms
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - p_company_id
              properties:
                p_company_id:
                  type: string
                  format: uuid
                  description: Organization UUID
      responses:
        '200':
          description: Forms listed successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      format: uuid
                    identifier:
                      type: string
                    name:
                      type: string
                    welcome_message:
                      type: string
                      nullable: true
                    is_active:
                      type: boolean
                    feedback_count:
                      type: integer
                    created_at:
                      type: string
                      format: date-time

  /rpc/update_form:
    post:
      tags:
        - Forms
      summary: Update a form
      description: |
        Updates form details including name, welcome message, and active status.

        **Access**: Authenticated (organization owner/member)
      operationId: updateForm
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - p_form_id
              properties:
                p_form_id:
                  type: string
                  format: uuid
                  description: Form UUID to update
                p_name:
                  type: string
                  maxLength: 255
                  nullable: true
                p_welcome_message:
                  type: string
                  maxLength: 500
                  nullable: true
                p_is_active:
                  type: boolean
                  nullable: true
      responses:
        '200':
          description: Form updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  form:
                    type: object

  /rpc/public_submit_feedback:
    post:
      tags:
        - Feedback
      summary: Submit anonymous feedback
      description: |
        Submits feedback from a guest. Supports both anonymous and contact modes.

        **Rate Limited**: 1 request per 30 seconds per client IP.

        **Validation**:
        - Feedback body: 5-5000 characters
        - No URLs allowed (spam prevention)
        - XSS content is sanitized server-side

        **Access**: Public (anonymous)
      operationId: publicSubmitFeedback
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - form_identifier
                - feedback_body
              properties:
                form_identifier:
                  type: string
                  description: Form identifier from QR code
                  example: "abc123xyz"
                feedback_body:
                  type: string
                  description: Guest feedback text
                  minLength: 5
                  maxLength: 5000
                  example: "The pasta was amazing! Great service too."
                feedback_mode:
                  type: string
                  enum:
                    - anonymous
                    - with_contact
                  default: anonymous
                  description: Feedback submission mode
                first_name:
                  type: string
                  maxLength: 100
                  nullable: true
                  description: Required if feedback_mode is 'with_contact'
                last_name:
                  type: string
                  maxLength: 100
                  nullable: true
                email:
                  type: string
                  format: email
                  nullable: true
                  description: Required if feedback_mode is 'with_contact'
                client_ip:
                  type: string
                  format: ipv4
                  nullable: true
                  description: Client IP for rate limiting (auto-detected if not provided)
      responses:
        '200':
          description: Feedback submitted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  feedback_id:
                    type: string
                    format: uuid
              example:
                success: true
                feedback_id: "123e4567-e89b-12d3-a456-426614174000"
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                success: false
                error: "Feedback must be between 5 and 5000 characters"
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                success: false
                error: "Please wait 30 seconds between submissions"

  /rpc/delete_feedback:
    post:
      tags:
        - Feedback
      summary: Delete feedback
      description: |
        Deletes a single feedback item. Requires owner/member/admin authorization.

        **Access**: Authenticated (organization owner/member)
      operationId: deleteFeedback
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - feedback_id
              properties:
                feedback_id:
                  type: string
                  format: uuid
      responses:
        '200':
          description: Feedback deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
        '403':
          description: Not authorized to delete this feedback

  /rpc/bulk_delete_feedback:
    post:
      tags:
        - Feedback
      summary: Bulk delete feedback
      description: |
        Deletes multiple feedback items at once. Authorization is checked per item.

        **Access**: Authenticated (organization owner/member)
      operationId: bulkDeleteFeedback
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - feedback_ids
              properties:
                feedback_ids:
                  type: array
                  items:
                    type: string
                    format: uuid
                  maxItems: 100
      responses:
        '200':
          description: Bulk delete completed
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  deleted_count:
                    type: integer
                  failed_count:
                    type: integer

  /rpc/get_public_templates:
    post:
      tags:
        - Templates
      summary: List public templates
      description: |
        Lists available survey templates, optionally filtered by category and language.
        Templates are ordered by featured status and popularity.

        **Supported Languages**: EN, SV, DE, FR, IT, NL

        **Categories**: restaurant, cowork

        **Access**: Public (anonymous)
      operationId: getPublicTemplates
      security: []
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                p_category:
                  type: string
                  enum:
                    - restaurant
                    - cowork
                  nullable: true
                  description: Filter by template category
                p_language:
                  type: string
                  enum:
                    - en
                    - sv
                    - de
                    - fr
                    - it
                    - nl
                  nullable: true
                  description: Filter by template language
      responses:
        '200':
          description: Templates listed successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Template'

  /rpc/get_template_by_slug:
    post:
      tags:
        - Templates
      summary: Get template by slug
      description: |
        Retrieves a single template by its URL slug for detail pages.

        **Access**: Public (anonymous)
      operationId: getTemplateBySlug
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - p_slug
              properties:
                p_slug:
                  type: string
                  example: "restaurant-feedback-en"
      responses:
        '200':
          description: Template found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Template'
        '404':
          description: Template not found

  /rpc/create_survey_from_template:
    post:
      tags:
        - Templates
        - Surveys
      summary: Create survey from template
      description: |
        Creates a new survey based on a template. Duplicates all template questions
        with KPI metadata preserved.

        **Access**: Authenticated (organization owner/member)
      operationId: createSurveyFromTemplate
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - p_location_id
                - p_template_id
              properties:
                p_location_id:
                  type: string
                  format: uuid
                  description: Location to assign the survey to
                p_template_id:
                  type: string
                  format: uuid
                  description: Template to create survey from
                p_custom_name:
                  type: string
                  maxLength: 255
                  nullable: true
                  description: Custom survey name (defaults to template name)
                p_language:
                  type: string
                  enum:
                    - en
                    - sv
                    - de
                    - fr
                    - it
                    - nl
                  nullable: true
                  description: Survey language (defaults to template language)
      responses:
        '200':
          description: Survey created successfully
          content:
            application/json:
              schema:
                type: string
                format: uuid
                description: New survey ID

  /rpc/get_survey_locations:
    post:
      tags:
        - Surveys
      summary: Get survey locations
      description: |
        Returns all active locations assigned to a survey with their unique QR tokens.

        **Access**: Authenticated (organization owner/member)
      operationId: getSurveyLocations
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - p_survey_id
              properties:
                p_survey_id:
                  type: string
                  format: uuid
      responses:
        '200':
          description: Locations retrieved successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    location_id:
                      type: string
                      format: uuid
                    location_name:
                      type: string
                    token:
                      type: string
                      description: Unique QR code token for this location

  /rpc/update_survey_locations:
    post:
      tags:
        - Surveys
      summary: Update survey locations
      description: |
        Replaces the survey-location assignments. Each location gets a unique QR token.

        **Access**: Authenticated (organization owner/member)
      operationId: updateSurveyLocations
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - p_survey_id
                - p_location_ids
              properties:
                p_survey_id:
                  type: string
                  format: uuid
                p_location_ids:
                  type: array
                  items:
                    type: string
                    format: uuid
      responses:
        '200':
          description: Locations updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean

  /rpc/get_survey_by_location_token:
    post:
      tags:
        - Surveys
      summary: Get survey by location token
      description: |
        Looks up survey and location details by the unique QR code token.
        Used when a guest scans a QR code at a specific location.

        **Access**: Public (anonymous)
      operationId: getSurveyByLocationToken
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - p_token
              properties:
                p_token:
                  type: string
                  description: 12-character location-specific token
                  example: "abc123def456"
      responses:
        '200':
          description: Survey found
          content:
            application/json:
              schema:
                type: object
                properties:
                  survey_id:
                    type: string
                    format: uuid
                  survey_name:
                    type: string
                  location_id:
                    type: string
                    format: uuid
                  location_name:
                    type: string
                  organization:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      name:
                        type: string
                      logo_url:
                        type: string
                        nullable: true
        '404':
          description: Invalid or expired token

  /rpc/validate_company_input:
    post:
      tags:
        - Validation
      summary: Validate organization input
      description: |
        Validates organization name and slug format before creation.

        **Validation Rules**:
        - Name: 2-100 characters
        - Slug: 3-50 characters, lowercase alphanumeric with hyphens, unique

        **Access**: Public (anonymous)
      operationId: validateCompanyInput
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - organization_name
                - slug
              properties:
                organization_name:
                  type: string
                  minLength: 2
                  maxLength: 100
                slug:
                  type: string
                  minLength: 3
                  maxLength: 50
                  pattern: "^[a-z0-9-]+$"
      responses:
        '200':
          description: Validation result
          content:
            application/json:
              schema:
                type: object
                properties:
                  valid:
                    type: boolean
                  errors:
                    type: array
                    items:
                      type: string

  /rpc/validate_customization_settings:
    post:
      tags:
        - Validation
      summary: Validate customization settings
      description: |
        Validates theme settings before saving.

        **Validation Rules**:
        - theme_name: Must be valid theme identifier
        - custom_css: Max 10KB
        - colors: Must be valid hex color codes

        **Access**: Authenticated
      operationId: validateCustomizationSettings
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - settings
              properties:
                settings:
                  type: object
                  properties:
                    theme_name:
                      type: string
                    primary_color:
                      type: string
                      pattern: "^#[0-9A-Fa-f]{6}$"
                    custom_css:
                      type: string
                      maxLength: 10240
      responses:
        '200':
          description: Validation result
          content:
            application/json:
              schema:
                type: object
                properties:
                  valid:
                    type: boolean
                  errors:
                    type: array
                    items:
                      type: string

  /rpc/can_activate_survey:
    post:
      tags:
        - Surveys
        - Validation
      summary: Check if survey can be activated
      description: |
        Checks if a survey has questions and can be activated for public use.

        **Access**: Authenticated
      operationId: canActivateSurvey
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - p_survey_id
              properties:
                p_survey_id:
                  type: string
                  format: uuid
      responses:
        '200':
          description: Activation check result
          content:
            application/json:
              schema:
                type: boolean

  /rpc/update_company_customization:
    post:
      tags:
        - Customization
      summary: Update organization customization
      description: |
        Updates the customization settings for an organization including theme,
        colors, and custom CSS.

        **Access**: Authenticated (organization owner)
      operationId: updateCompanyCustomization
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - p_company_id
                - settings
              properties:
                p_company_id:
                  type: string
                  format: uuid
                  description: Organization UUID
                settings:
                  type: object
                  description: Customization settings object
                  properties:
                    theme_name:
                      type: string
                      description: Theme identifier
                      example: "modern"
                    primary_color:
                      type: string
                      pattern: "^#[0-9A-Fa-f]{6}$"
                      example: "#667eea"
                    secondary_color:
                      type: string
                      pattern: "^#[0-9A-Fa-f]{6}$"
                      example: "#764ba2"
                    custom_css:
                      type: string
                      maxLength: 10240
                      description: Custom CSS (max 10KB)
      responses:
        '200':
          description: Customization updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
        '400':
          description: Invalid settings
        '403':
          description: Not authorized to update this organization

  # Edge Function Webhooks (Internal)
  /functions/v1/send-feedback-notification:
    post:
      tags:
        - Webhooks
      summary: Send feedback notification (Internal)
      description: |
        Triggered automatically when new feedback is submitted.
        Sends an email notification to the organization owner.

        **Trigger**: Database INSERT on `feedback` table
        **Internal**: Not intended for direct API calls
      operationId: sendFeedbackNotification
      security: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                record:
                  type: object
                  properties:
                    id:
                      type: string
                      format: uuid
                    body:
                      type: string
                    company_id:
                      type: string
                      format: uuid
                    created_at:
                      type: string
                      format: date-time
      responses:
        '200':
          description: Notification sent
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  feedbackId:
                    type: string
                  companyName:
                    type: string
        '500':
          description: Internal error

  /functions/v1/generate-weekly-digest:
    post:
      tags:
        - Webhooks
      summary: Generate weekly digest (Scheduled)
      description: |
        Scheduled job that generates weekly analytics digests and sends email summaries.

        **Schedule**: Every Sunday at 9:00 AM UTC
        **Internal**: Triggered by pg_cron via pg_net, not for direct calls

        **Digest Contents**:
        - Score normalization and submission health
        - Response volume and trends
        - Top themes and concerns
        - Per-location breakdowns
        - Stored in weekly_digests table for in-app viewing
      operationId: generateWeeklyDigest
      security: []
      responses:
        '200':
          description: Digest generated and emails sent
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  digestsGenerated:
                    type: integer
                  emailsSent:
                    type: integer

components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |
        Supabase JWT token obtained via authentication.

        Also requires the `apikey` header with your Supabase anon key.
    apiKey:
      type: apiKey
      in: header
      name: apikey
      description: Supabase project anon key

  schemas:
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          example: "An error occurred"

    Template:
      type: object
      properties:
        id:
          type: string
          format: uuid
        slug:
          type: string
          example: "restaurant-feedback-en"
        name:
          type: string
          example: "Restaurant Feedback"
        description:
          type: string
        category:
          type: string
          enum:
            - restaurant
            - cowork
        language:
          type: string
          enum:
            - en
            - sv
            - de
            - fr
            - it
            - nl
        is_featured:
          type: boolean
        popularity_score:
          type: integer
        questions:
          type: array
          description: Pre-defined survey questions
          items:
            $ref: '#/components/schemas/TemplateQuestion'
        created_at:
          type: string
          format: date-time

    TemplateQuestion:
      type: object
      properties:
        question_text:
          type: string
        question_type:
          type: string
          enum:
            - rating
            - text
            - multiple_choice
            - nps
        is_required:
          type: boolean
        options:
          type: array
          items:
            type: string
          nullable: true
        kpi:
          type: boolean
          description: Whether this question tracks a KPI
        kpi_key:
          type: string
          enum:
            - overall_satisfaction
            - nps
            - value_for_money
          nullable: true
        help_text:
          type: string
          nullable: true

    Survey:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        organization_id:
          type: string
          format: uuid
        is_active:
          type: boolean
        token:
          type: string
          description: Public survey token
        created_at:
          type: string
          format: date-time

    Feedback:
      type: object
      properties:
        id:
          type: string
          format: uuid
        form_id:
          type: string
          format: uuid
        body:
          type: string
        sentiment:
          type: string
          enum:
            - positive
            - neutral
            - negative
          nullable: true
        emoji_reaction:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time

    Organization:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        slug:
          type: string
        logo_url:
          type: string
          nullable: true
        preferred_language:
          type: string
          enum:
            - en
            - sv
            - de
            - fr
            - it
            - nl
        created_at:
          type: string
          format: date-time
