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

# Update a site

> Changes the settings sent and leaves the rest, as the dashboard does. A list sent replaces the whole list, and each setting says when it takes effect.



## OpenAPI

````yaml https://api.highseat.com/v1/openapi.json patch /sites/{site}
openapi: 3.1.1
info:
  title: Highseat Stats API
  version: 1.0.0
  description: >-
    The same figures the dashboard shows, and the changes an admin makes there.
    A read key answers every GET route; a write key also answers the routes that
    change data.


    Authentication, write keys, idempotency, limits and the shape of every
    response: https://highseat.com/docs/api.
  license:
    name: Proprietary
servers:
  - url: https://api.highseat.com/v1
security:
  - bearerAuth: []
paths:
  /sites/{site}:
    patch:
      tags:
        - Sites
      summary: Update a site
      description: >-
        Changes the settings sent and leaves the rest, as the dashboard does. A
        list sent replaces the whole list, and each setting says when it takes
        effect.
      operationId: updateSite
      parameters:
        - name: site
          in: path
          required: true
          schema:
            type: string
            description: 'The site: its domain as registered (example.com), or its site id.'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 100
                  description: The site's name, as the dashboard shows it.
                domain:
                  type: string
                  minLength: 3
                  maxLength: 253
                  pattern: ^((\*\.)|((?!-)[a-z0-9-]{0,63}[a-z0-9]\.))+[a-z]{2,63}$
                  description: >-
                    The site's hostname, subdomains included. A domain another
                    site of the workspace holds answers 409 DOMAIN_TAKEN.
                timezone:
                  type: string
                  description: >-
                    IANA timezone every day boundary falls in, such as
                    Europe/Warsaw.
                revenueMode:
                  enum:
                    - traffic
                    - balanced
                    - revenue
                  type: string
                  description: >-
                    What the site's dashboard leads with: `traffic`, `balanced`
                    or `revenue`. Display only: nothing stored and no figure of
                    the API changes.
                attributionModel:
                  enum:
                    - last
                    - first
                    - linear
                  type: string
                  description: >-
                    Which pageview before a sale takes its credit in revenue
                    split by page, source or campaign: the last, the first, or
                    every one equally (`linear`). Applied when a report runs, so
                    a change re-credits every past sale.
                attributionLookback:
                  enum:
                    - 7
                    - 14
                    - 30
                    - 90
                  description: >-
                    Days before a sale a pageview may lie and still earn credit:
                    7, 14, 30 or 90. Applied when a report runs, so a change
                    re-credits every past sale.
                thankYouPaths:
                  type: array
                  maxItems: 100
                  items:
                    type: string
                    minLength: 1
                    maxLength: 500
                    pattern: ^\/.*
                  description: >-
                    Paths attribution never credits as a touch, `*` wildcards
                    allowed: the page a checkout returns to. Applied when a
                    report runs, so a change re-credits every past sale.
                keptQueryParams:
                  type: array
                  maxItems: 50
                  items:
                    type: string
                    minLength: 1
                    maxLength: 64
                    pattern: ^[A-Za-z0-9._~-]+$
                  description: >-
                    Query parameter names ingest keeps on a page's URL,
                    stripping every other one. A change reaches new events only.
                excludedIps:
                  type: array
                  maxItems: 100
                  items:
                    type: string
                    minLength: 1
                    maxLength: 64
                  description: >-
                    IP addresses and CIDR ranges whose events ingest drops. No
                    visitor IP is stored, so a change reaches new events only.
                excludedPaths:
                  type: array
                  maxItems: 100
                  items:
                    type: string
                    minLength: 1
                    maxLength: 500
                    pattern: ^\/.*
                  description: >-
                    Paths whose events ingest drops, `*` wildcards allowed. A
                    change reaches new events only.
                extraHostnames:
                  type: array
                  maxItems: 20
                  items:
                    type: string
                    minLength: 1
                    maxLength: 253
                    pattern: ^(?:\*\.)?(?:(?!-)[a-z0-9-]{0,62}[a-z0-9]\.)+[a-z]{2,63}$
                  description: >-
                    Hostnames ingest counts besides the domain and its
                    subdomains: an exact name, or `*.example.com` for that
                    domain and its subdomains. A change reaches new events only.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      name:
                        type: string
                      domain:
                        type: string
                        description: The site's hostname, which also names it in a path.
                      timezone:
                        type: string
                        description: IANA timezone every day boundary falls in.
                      reportingCurrency:
                        type: string
                        description: >-
                          ISO 4217 code every amount is reported in. PUT
                          /sites/{site}/reporting-currency changes it.
                      revenueMode:
                        enum:
                          - traffic
                          - balanced
                          - revenue
                        type: string
                        description: >-
                          What the site's dashboard leads with: `traffic`,
                          `balanced` or `revenue`. Display only: nothing stored
                          and no figure of the API changes.
                      attributionModel:
                        enum:
                          - last
                          - first
                          - linear
                        type: string
                        description: >-
                          Which pageview before a sale takes its credit in
                          revenue split by page, source or campaign: the last,
                          the first, or every one equally (`linear`). Applied
                          when a report runs, so a change re-credits every past
                          sale.
                      attributionLookback:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                        description: >-
                          Days before a sale a pageview may lie and still earn
                          credit: 7, 14, 30 or 90. Applied when a report runs,
                          so a change re-credits every past sale.
                      thankYouPaths:
                        type: array
                        items:
                          type: string
                        description: >-
                          Paths attribution never credits as a touch, `*`
                          wildcards allowed: the page a checkout returns to.
                          Applied when a report runs, so a change re-credits
                          every past sale.
                      keptQueryParams:
                        type: array
                        items:
                          type: string
                        description: >-
                          Query parameter names ingest keeps on a page's URL,
                          stripping every other one. A change reaches new events
                          only.
                      excludedIps:
                        type: array
                        items:
                          type: string
                        description: >-
                          IP addresses and CIDR ranges whose events ingest
                          drops. Left out of a read key's answer, since an
                          address is personal data.
                      excludedPaths:
                        type: array
                        items:
                          type: string
                        description: >-
                          Paths whose events ingest drops, `*` wildcards
                          allowed. A change reaches new events only.
                      extraHostnames:
                        type: array
                        items:
                          type: string
                        description: >-
                          Hostnames ingest counts besides the domain and its
                          subdomains: an exact name, or `*.example.com` for that
                          domain and its subdomains. A change reaches new events
                          only.
                      proxyPath:
                        type: string
                        description: >-
                          The path the site's first-party proxy serves the
                          script and takes events on, such as /3f9a1c2b7e.
                      secretHint:
                        anyOf:
                          - type: string
                          - type: 'null'
                        description: >-
                          The last four characters of the site secret a proxy or
                          backend sends. Null while the site has none: POST
                          /sites/{site}/secret mints it.
                      firstEventAt:
                        anyOf:
                          - type: string
                            format: date-time
                            x-native-type: date
                          - type: 'null'
                        description: >-
                          ISO 8601 in UTC: the site's earliest event. Null
                          before the first one.
                      createdAt:
                        type: string
                        format: date-time
                        x-native-type: date
                        description: 'ISO 8601 in UTC: when the site was added.'
                    required:
                      - id
                      - name
                      - domain
                      - timezone
                      - reportingCurrency
                      - revenueMode
                      - attributionModel
                      - attributionLookback
                      - thankYouPaths
                      - keptQueryParams
                      - excludedPaths
                      - extraHostnames
                      - proxyPath
                      - secretHint
                      - firstEventAt
                      - createdAt
                required:
                  - data
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
            RateLimit:
              $ref: '#/components/headers/RateLimit'
        '400':
          $ref: '#/components/responses/WriteError400'
        '401':
          $ref: '#/components/responses/Error401'
        '403':
          $ref: '#/components/responses/WriteError403'
        '404':
          $ref: '#/components/responses/Error404'
        '409':
          $ref: '#/components/responses/WriteError409'
        '413':
          $ref: '#/components/responses/WriteError413'
        '422':
          $ref: '#/components/responses/WriteError422'
        '429':
          $ref: '#/components/responses/Error429'
        '503':
          $ref: '#/components/responses/Error503'
components:
  headers:
    RateLimit-Limit:
      description: Calls the key may make in the window.
      schema:
        type: integer
    RateLimit-Remaining:
      description: Calls left in the current window.
      schema:
        type: integer
    RateLimit-Reset:
      description: Seconds until the window reopens.
      schema:
        type: integer
    RateLimit-Policy:
      description: >-
        The quota and window, as the IETF draft writes it:
        "hourly";q=600;w=3600.
      schema:
        type: string
    RateLimit:
      description: >-
        The remaining budget, as the IETF draft writes it:
        "hourly";r=599;t=3540.
      schema:
        type: string
    Retry-After:
      description: Seconds to wait before the next call.
      schema:
        type: integer
  responses:
    WriteError400:
      description: >-
        The request is malformed, or its Idempotency-Key is not 1 to 255
        characters: BAD_REQUEST.
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
        RateLimit:
          $ref: '#/components/headers/RateLimit'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error401:
      description: 'No API key, or one that is not valid: UNAUTHORIZED.'
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
        RateLimit:
          $ref: '#/components/headers/RateLimit'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    WriteError403:
      description: >-
        The key can only read (KEY_READ_ONLY), or the workspace is closed until
        it pays and takes no changes (FORBIDDEN).
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
        RateLimit:
          $ref: '#/components/headers/RateLimit'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error404:
      description: 'The site, the row the path names or the route does not exist: NOT_FOUND.'
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
        RateLimit:
          $ref: '#/components/headers/RateLimit'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    WriteError409:
      description: >-
        The change conflicts with a row that exists (CONFLICT, or the write's
        own code, which carries the row's `id`), or a request with the same
        Idempotency-Key still runs (IDEMPOTENCY_KEY_IN_USE).
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
        RateLimit:
          $ref: '#/components/headers/RateLimit'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    WriteError413:
      description: 'The body is over 1 MB: PAYLOAD_TOO_LARGE.'
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
        RateLimit:
          $ref: '#/components/headers/RateLimit'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    WriteError422:
      description: >-
        The Idempotency-Key was sent with another request in the last 24 hours
        (IDEMPOTENCY_KEY_REUSED), or the site already has as many rows of this
        kind as it may save (the write's own code, such as GOAL_LIMIT_REACHED).
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
        RateLimit:
          $ref: '#/components/headers/RateLimit'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error429:
      description: >-
        The key has used its hourly budget (RATE_LIMITED), or its workspace
        already runs as many calls at once as it may
        (TOO_MANY_CONCURRENT_REQUESTS).
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
        RateLimit:
          $ref: '#/components/headers/RateLimit'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error503:
      description: 'The server is busy; retry in a moment: SERVICE_UNAVAILABLE.'
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        RateLimit-Policy:
          $ref: '#/components/headers/RateLimit-Policy'
        RateLimit:
          $ref: '#/components/headers/RateLimit'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: >-
                Stable and machine-readable: BAD_REQUEST, INVALID_FILTER,
                INVALID_CURSOR, UNAUTHORIZED, FORBIDDEN, KEY_READ_ONLY,
                NOT_FOUND, METHOD_NOT_ALLOWED, CONFLICT, IDEMPOTENCY_KEY_IN_USE,
                PAYLOAD_TOO_LARGE, IDEMPOTENCY_KEY_REUSED, QUERY_TIMEOUT,
                RATE_LIMITED, TOO_MANY_CONCURRENT_REQUESTS, SERVICE_UNAVAILABLE
                or INTERNAL_SERVER_ERROR. A write may answer a code of its own:
                a conflict (GOAL_EXISTS, DOMAIN_TAKEN, SECRET_EXISTS) or a limit
                (GOAL_LIMIT_REACHED, FUNNEL_LIMIT_REACHED). Codes are added,
                never renamed.
            message:
              type: string
              description: What went wrong, written for a person.
            id:
              type: string
              description: >-
                On a conflict, the existing row's id, so a client can update it
                instead.
            issues:
              type: array
              items:
                type: object
                properties:
                  path:
                    type: array
                    items:
                      anyOf:
                        - type: string
                        - type: number
                    description: >-
                      The parameter at fault, e.g. ['filter', 1] for the second
                      filter.
                  message:
                    type: string
                required:
                  - path
                  - message
              description: One entry per invalid parameter.
          required:
            - code
            - message
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.