> ## 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.

# Update Website

> Update a website's information.



## OpenAPI

````yaml patch /websites/{hostname}
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/{hostname}:
    patch:
      tags:
        - Website
      summary: Update Website
      description: Update a website's information.
      operationId: patch-websites-id
      parameters:
        - $ref: '#/components/parameters/SessionAuth'
        - $ref: '#/components/parameters/Hostname'
      requestBody:
        description: Website details to update.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebsitePatch'
        required: true
      responses:
        '200':
          description: Success
          headers:
            X-Api-Commit:
              $ref: '#/components/headers/X-Api-Commit'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebsiteGet'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorisedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '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
    Hostname:
      name: hostname
      in: path
      description: Hostname for the website.
      required: true
      schema:
        type: string
        minLength: 1
        maxLength: 253
        format: hostname
  schemas:
    WebsitePatch:
      type: object
      title: WebsitePatch
      description: Request body for updating a website.
      properties:
        hostname:
          type: string
          minLength: 1
          maxLength: 253
          format: hostname
    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
  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
  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
    ForbiddenError:
      description: 403 Forbidden.
      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: 403
                  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.

````