> ## Documentation Index
> Fetch the complete documentation index at: https://medama.mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.

# List Websites

> Get a list of all websites from the user.



## OpenAPI

````yaml get /websites
openapi: 3.0.3
info:
  title: Medama Analytics API
  version: 0.5.0
  description: |
    This is the Medama Analytics OpenAPI 3.0 specification.
  contact:
    email: hello@ayuhito.com
    name: Medama Analytics
    url: https://medama.io/contact
  license:
    url: https://github.com/medama-io/medama/blob/main/core/LICENSE
    name: Apache License 2.0
servers:
  - url: http://localhost:8080
    description: Local Server
security: []
tags:
  - name: Authentication
    description: Authentication
  - name: Event
    description: Page Events
  - name: User
    description: User Management
  - name: Website
    description: Website Management
  - name: Stats
    description: Statistics
paths:
  /websites:
    get:
      tags:
        - Website
      summary: List Websites
      description: Get a list of all websites from the user.
      operationId: get-websites
      parameters:
        - $ref: '#/components/parameters/SessionAuth'
        - $ref: '#/components/parameters/Summary'
      responses:
        '200':
          description: Returns a list of websites.
          headers:
            X-Api-Commit:
              $ref: '#/components/headers/X-Api-Commit'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/WebsiteGet'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorisedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - CookieAuth: []
components:
  parameters:
    SessionAuth:
      name: _me_sess
      in: cookie
      description: Session token for authentication.
      required: true
      schema:
        type: string
        example: _me_sess=token; Path=/; HttpOnly; SameSite=Lax; Secure
    Summary:
      name: summary
      in: query
      description: Return a summary of the stats.
      required: false
      schema:
        type: boolean
        default: false
  headers:
    X-Api-Commit:
      description: >-
        A custom header used to identify the commit of the API. This can be used
        to force reload the client if the API has been updated.
      schema:
        type: string
        example: 97dd2ae
  schemas:
    WebsiteGet:
      type: object
      title: WebsiteGet
      description: Response body for getting a website.
      properties:
        hostname:
          type: string
          minLength: 1
          maxLength: 253
          format: hostname
        summary:
          type: object
          properties:
            visitors:
              type: integer
          required:
            - visitors
      required:
        - hostname
  responses:
    BadRequestError:
      description: 400 Bad Request.
      headers:
        X-Api-Commit:
          $ref: '#/components/headers/X-Api-Commit'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                additionalProperties: false
                properties:
                  code:
                    type: integer
                    format: int32
                    default: 400
                  message:
                    type: string
                required:
                  - code
                  - message
            required:
              - error
    UnauthorisedError:
      description: 401 Unauthorised.
      headers:
        X-Api-Commit:
          $ref: '#/components/headers/X-Api-Commit'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                additionalProperties: false
                properties:
                  code:
                    type: integer
                    format: int32
                    default: 401
                  message:
                    type: string
                required:
                  - code
                  - message
            required:
              - error
    NotFoundError:
      description: 404 Not Found.
      headers:
        X-Api-Commit:
          $ref: '#/components/headers/X-Api-Commit'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                additionalProperties: false
                properties:
                  code:
                    type: integer
                    format: int32
                    default: 404
                  message:
                    type: string
                required:
                  - code
                  - message
            required:
              - error
    InternalServerError:
      description: 500 Unexpected Internal Server Error.
      headers:
        X-Api-Commit:
          $ref: '#/components/headers/X-Api-Commit'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                additionalProperties: false
                properties:
                  code:
                    type: integer
                    format: int32
                    default: 500
                  message:
                    type: string
                required:
                  - code
                  - message
            required:
              - error
  securitySchemes:
    CookieAuth:
      name: _me_sess
      in: cookie
      type: apiKey
      description: Session token for authentication.

````