Swetrix Views API

Manage saved dashboard views (segments)

Operations 5

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /v1/project/{pid}/views List a project's saved dashboard views · List Project Views #
Ask an LLM
“Which saved segments exist on my project's dashboard?”
“Can I list saved views on a password-protected project?”
Tell an agent
List the saved views for project {pid}.
Show every saved dashboard segment in project {pid}.
POST /v1/project/{pid}/views Save a new dashboard view or segment · Create Project View #
Ask an LLM
“How do I save a filtered segment of my dashboard for reuse?”
“Can a saved view include both filters and custom events?”
Tell an agent
Create a {type} view named {name} in project {pid}.
Save a new {type} segment {name} in project {pid} with filters {filters}.
GET /v1/project/{pid}/views/{viewId} View one saved dashboard view's configuration · Get Project View #
Ask an LLM
“What filters are stored in a particular saved view?”
“Can I fetch a single saved segment's settings by its ID?”
Tell an agent
Get saved view {viewId} in project {pid}.
Show the configuration of segment {viewId} on project {pid}.
PATCH /v1/project/{pid}/views/{viewId} Change a saved view's name, filters or events · Update Project View #
Ask an LLM
“Can I change the filters on a segment I already saved?”
“Is renaming an existing saved view possible?”
Tell an agent
Rename saved view {viewId} in project {pid} to {name}.
Update the filters of existing view {viewId} on project {pid} to {filters}.
DELETE /v1/project/{pid}/views/{viewId} Delete a saved dashboard view · Delete Project View #
Ask an LLM
“How do I get rid of a saved segment I don't use anymore?”
“Can I delete one saved view from a project's dashboard?”
Tell an agent destructive · confirm first
Delete saved view {viewId} from project {pid}.
Remove segment {viewId} on project {pid}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/swetrix:swetrix-views-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

swetrix-views-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Swetrix Admin Views API
  description: The Swetrix Admin API manages analytics projects, funnels, annotations, project views (segments), and organisations. Supports full CRUD operations for all Swetrix account resources. All requests require authentication via the X-Api-Key header. Rate limit is 600 requests/hour.
  version: '1.0'
  contact:
    name: Swetrix Support
    url: https://swetrix.com/contact
  termsOfService: https://swetrix.com/privacy
  license:
    name: AGPL-3.0
    url: https://github.com/Swetrix/swetrix-api/blob/main/LICENSE
servers:
- url: https://api.swetrix.com
  description: Swetrix Production API
security:
- ApiKeyAuth: []
tags:
- name: Views
  description: Manage saved dashboard views (segments)
paths:
  /v1/project/{pid}/views:
    get:
      operationId: listViews
      summary: List Project Views
      description: Returns all saved dashboard views (segments) for a project. Optional X-Password header for password-protected projects.
      tags:
      - Views
      parameters:
      - name: pid
        in: path
        required: true
        schema:
          type: string
        description: Project ID
      responses:
        '200':
          description: Array of saved views
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ProjectView'
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      operationId: createView
      summary: Create Project View
      description: Creates a new saved dashboard view (segment) for a project.
      tags:
      - Views
      parameters:
      - name: pid
        in: path
        required: true
        schema:
          type: string
        description: Project ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateViewRequest'
      responses:
        '201':
          description: View created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectView'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /v1/project/{pid}/views/{viewId}:
    get:
      operationId: getView
      summary: Get Project View
      description: Retrieves a single saved dashboard view configuration.
      tags:
      - Views
      parameters:
      - name: pid
        in: path
        required: true
        schema:
          type: string
      - name: viewId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: View configuration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectView'
        '401':
          $ref: '#/components/responses/Unauthorized'
    patch:
      operationId: updateView
      summary: Update Project View
      description: Updates an existing saved view's name, filters, or custom events.
      tags:
      - Views
      parameters:
      - name: pid
        in: path
        required: true
        schema:
          type: string
      - name: viewId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateViewRequest'
      responses:
        '200':
          description: Updated view
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectView'
        '401':
          $ref: '#/components/responses/Unauthorized'
    delete:
      operationId: deleteView
      summary: Delete Project View
      description: Removes a saved dashboard view.
      tags:
      - Views
      parameters:
      - name: pid
        in: path
        required: true
        schema:
          type: string
      - name: viewId
        in: path
        required: true
        schema:
          type: string
      responses:
        '204':
          description: View deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  responses:
    BadRequest:
      description: Bad request - malformed body or missing required fields
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
    Unauthorized:
      description: Unauthorized - missing or invalid API key
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
  schemas:
    CreateViewRequest:
      type: object
      required:
      - name
      - type
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 20
        type:
          type: string
          enum:
          - traffic
          - performance
        filters:
          type: array
          items:
            type: object
        customEvents:
          type: array
          items:
            type: string
          maxItems: 3
    ProjectView:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        type:
          type: string
          enum:
          - traffic
          - performance
        filters:
          type: array
          items:
            type: object
        customEvents:
          type: array
          items:
            type: string
    UpdateViewRequest:
      type: object
      properties:
        name:
          type: string
          maxLength: 20
        filters:
          type: array
          items:
            type: object
        customEvents:
          type: array
          items:
            type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: API key from Swetrix account settings (https://swetrix.com/user-settings)
externalDocs:
  description: Swetrix Admin API Documentation
  url: https://swetrix.com/docs/admin-api