CustomGPT Schema for MainWP REST API V2

Available with the following:
MainWP Core
Table of Contents

Below, you will find Schema necessary to configure a CustomGPT to work with MainWP REST API v2.

Please see our YouTube video for the entire instructions on creating the CustomGPT.

NOTE: CustomGPT limits the number of calls that can be used in a schema to 30. So please switch up the calls in the schema below to suit your needs if necessary.

info:
  contact: {}
  description: "# Overview The MainWP API uses REST conventions and returns all data in JSON format. Requests may be made
    using the HTTPS protocol and must be authenticated using a **API Key (bearer token)**"
  title: MainWP REST API
  version: 2.0.0
openapi: 3.1.0
servers:
  - url: https://example.com
paths:
  /wp-json/mainwp/v2/sites/basic:
    get:
      description: Retreives information about Child Sites connected to a MainWP Dashboard.
      operationId: getAllSites
      parameters:
        - name: page
          description: Current page of the collection.
          in: query
          required: false
          schema:
            type: integer
        - name: per_page
          description: Maximum number of items to be returned in result set.
          in: query
          required: false
          schema:
            type: integer
        - name: search
          description: Limit results to those matching a string - search in title name and URL.
          in: query
          required: false
          schema:
            type: string
        - name: exclude
          description: Ensure result set excludes specific IDs.
          in: query
          required: false
          schema:
            type: string
        - name: include
          description: Limit result set to specific IDs.
          in: query
          required: false
          schema:
            type: string
        - name: status
          description: Limit result set to products assigned a specific status.
          in: query
          required: false
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: Get all sites.
      tags:
        - Sites
  /wp-json/mainwp/v2/sites/sync:
    post:
      description: Triggers the sync process for all sites.
      operationId: syncAllSites
      parameters:
        - name: exclude
          description: Ensure result set excludes specific IDs.
          in: query
          required: false
          schema:
            type: string
        - name: include
          description: Limit result set to specific IDs.
          in: query
          required: false
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:

        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: Sync all sites.
      tags:
        - Sites
  /wp-json/mainwp/v2/sites/check:
    post:
      description: Runs the check sites process for all sites.
      operationId: checkAllSites
      parameters:
        - name: exclude
          description: Ensure result set excludes specific IDs.
          in: query
          required: false
          schema:
            type: string
        - name: include
          description: Limit result set to specific IDs.
          in: query
          required: false
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: Check sites.
      tags:
        - Sites
  /wp-json/mainwp/v2/sites/add:
    put:
      description: Adds a new site to MainWP Dashboard.
      operationId: addSite
      parameters:
        - name: url
          description: The URL of the child site to be added.
          in: query
          required: true
          schema:
            type: string
        - name: name
          description: The name of the child site.
          in: query
          required: true
          schema:
            type: string
        - name: admin
          description: The username of an administrator on the child site.
          in: query
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: Add new site.
      tags:
        - Sites
  /wp-json/mainwp/v2/sites/{site}:
    get:
      description: Retrieves inforomation about child site by ID or Domain.
      operationId: getSite
      parameters:
        - name: site
          description: ID or Domain of child site.
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: Get site by ID or Domain.
      tags:
        - Sites
  /wp-json/mainwp/v2/sites/{site}/edit:
    put:
      description: Edits site information.
      operationId: editSite
      parameters:
        - name: site
          description: ID or Domain of child site.
          in: path
          required: true
          schema:
            type: string
        - name: groupids
          description: IDs of a Tag the Child Site belongs to.
          in: query
          required: false
          schema:
            type: string
        - name: name
          description: The name of the child site.
          in: query
          required: false
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: Edit site.
      tags:
        - Sites
  /wp-json/mainwp/v2/sites/{site}/sync:
    post:
      description: Syncs a Child Site by ID or Domain.
      operationId: syncSite
      parameters:
        - name: site
          description: ID or Domain of child site.
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: Sync child site.
      tags:
        - Sites
  /wp-json/mainwp/v2/sites/{site}/plugins:
    get:
      description: Gets plugin information for a Child Site by ID or Domain.
      operationId: sitePlugins
      parameters:
        - name: site
          description: ID or Domain of child site.
          in: path
          required: true
          schema:
            type: string
        - name: page
          description: Current page of the collection.
          in: query
          required: false
          schema:
            type: string
        - name: per_page
          description: Maximum number of items to be returned in result set.
          in: query
          required: false
          schema:
            type: string
        - name: search
          description: Limit results to those matching a string.
          in: query
          required: false
          schema:
            type: string
        - name: status
          description: Limit result set to products assigned a specific status.
          in: query
          required: false
          schema:
            type: string
        - name: must_use
          description: Limits results to show only MU plugins if set to 1.
          in: query
          required: false
          schema:
            type: integer
            maximum: 1
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: Get site plugins info.
      tags:
        - Sites
  /wp-json/mainwp/v2/sites/{site}/plugins/activate:
    post:
      description: Activate a plugin (by slug) on a Child Site defined by ID or Domain.
      operationId: siteActivatePlugin
      parameters:
        - name: site
          description: ID or Domain of child site.
          in: path
          required: true
          schema:
            type: string
        - name: slug
          description: Slug of the plugin to activate.
          in: query
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: Activate plugin on a site.
      tags:
        - Sites
  /wp-json/mainwp/v2/sites/{site}/plugins/deactivate:
    post:
      description: Dectivate a plugin (by slug) on a Child Site defined by ID or Domain.
      operationId: siteDeactivatePlugin
      parameters:
        - name: site
          description: ID or Domain of child site.
          in: path
          required: true
          schema:
            type: string
        - name: slug
          description: Slug of the plugin to deactivate.
          in: query
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: Deactivate plugin on a site.
      tags:
        - Sites
  /wp-json/mainwp/v2/sites/{site}/themes:
    get:
      description: Gets theme information for a Child Site by ID or Domain.
      operationId: siteThemes
      parameters:
        - name: site
          description: ID or Domain of child site.
          in: path
          required: true
          schema:
            type: string
        - name: page
          description: Current page of the collection.
          in: query
          required: false
          schema:
            type: string
        - name: per_page
          description: Maximum number of items to be returned in result set.
          in: query
          required: false
          schema:
            type: string
        - name: search
          description: Limit results to those matching a string.
          in: query
          required: false
          schema:
            type: string
        - name: status
          description: Limit result set to products assigned a specific status.
          in: query
          required: false
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: Get site themes info.
      tags:
        - Sites
  /wp-json/mainwp/v2/sites/{site}/themes/activate:
    post:
      description: Activate a theme (by slug) on a Child Site defined by ID or Domain.
      operationId: siteActivateTheme
      parameters:
        - name: site
          description: ID or Domain of child site.
          in: path
          required: true
          schema:
            type: string
        - name: slug
          description: Slug of the theme to activate.
          in: query
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: Activate theme on a site.
      tags:
        - Sites
  /wp-json/mainwp/v2/sites/{site}/non-mainwp-changes:
    get:
      description: Gets a list of Non-MainWP Changes for a Child Site by ID or Domain.
      operationId: siteNonMainWPChanges
      parameters:
        - name: site
          description: ID or Domain of child site.
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: Get non MainWP changes.
      tags:
        - Sites
  /wp-json/mainwp/v2/sites/{site}/reconnect:
    post:
      description: Reconnects Child Site by ID or Domain.
      operationId: reconnectSite
      parameters:
        - name: site
          description: ID or Domain of child site.
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: /sites/{site}/reconnect/ - Reconnect child site.
      tags:
        - Sites
  /wp-json/mainwp/v2/sites/{site}/suspend:
    post:
      description: Suspend Child Site by ID or Domain.
      operationId: suspendSite
      parameters:
        - name: site
          description: ID or Domain of child site.
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: /sites/{site}/suspend/ - Suspend child site.
      tags:
        - Sites
  /wp-json/mainwp/v2/sites/{site}/unsuspend:
    post:
      description: Unsuspend Child Site by ID or Domain.
      operationId: unsuspendSite
      parameters:
        - name: site
          description: ID or Domain of child site.
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: /sites/{site}/unsuspend/ - Unsuspend child site.
      tags:
        - Sites
  /wp-json/mainwp/v2/clients:
    get:
      description: Retreives information about Clients.
      operationId: getAllClients
      parameters:
        - name: page
          description: Current page of the collection.
          in: query
          required: false
          schema:
            type: integer
        - name: per_page
          description: Maximum number of items to be returned in result set.
          in: query
          required: false
          schema:
            type: integer
        - name: search
          description: Limit results to those matching a string - search in title name and URL.
          in: query
          required: false
          schema:
            type: string
        - name: exclude
          description: Ensure result set excludes specific IDs.
          in: query
          required: false
          schema:
            type: string
        - name: include
          description: Limit result set to specific IDs.
          in: query
          required: false
          schema:
            type: string
        - name: status
          description: Limit result set to products assigned a specific status.
          in: query
          required: false
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: /clients - Get all clients.
      tags:
        - Clients
  /wp-json/mainwp/v2/clients/add:
    post:
      description: Adds a new Client to MainWP Dashboard.
      operationId: addClient
      parameters:
        - name: email
          description: Email of the client to be added.
          in: query
          required: true
          schema:
            type: string
        - name: name
          description: The name of the client.
          in: query
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: /clients/add/ - Add new client.
      tags:
        - Clients
  /wp-json/mainwp/v2/clients/{client}:
    get:
      description: Retrieves inforomation about client by ID or Email.
      operationId: getClient
      parameters:
        - name: client
          description: ID or Email of the client.
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: /clients/{client}/ - Get client by ID or Email.
      tags:
        - Clients
  /wp-json/mainwp/v2/clients/{client}/edit:
    put:
      description: Updates client data.
      operationId: editClient
      parameters:
        - name: client
          description: ID or Email of the client.
          in: path
          required: true
          schema:
            type: string
        - name: email
          description: Email of the client to be added.
          in: query
          required: false
          schema:
            type: string
        - name: name
          description: The name of the client.
          in: query
          required: false
          schema:
            type: string
        - name: selected_sites
          description: IDs of Child Sites associated to the Client.
          in: query
          required: false
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: /clients/{client}/edit/ - Modify client info.
      tags:
        - Clients
  /wp-json/mainwp/v2/costs:
    get:
      description: Retreives information about Costs.
      operationId: getAllCosts
      parameters:
        - name: page
          description: Current page of the collection.
          in: query
          required: false
          schema:
            type: integer
        - name: per_page
          description: Maximum number of items to be returned in result set.
          in: query
          required: false
          schema:
            type: integer
        - name: search
          description: Limit results to those matching a string - search in title name and URL.
          in: query
          required: false
          schema:
            type: string
        - name: exclude
          description: Ensure result set excludes specific IDs.
          in: query
          required: false
          schema:
            type: string
        - name: include
          description: Limit result set to specific IDs.
          in: query
          required: false
          schema:
            type: string
        - name: status
          description: Limit result set to products assigned a specific status.
          in: query
          required: false
          schema:
            type: string
        - name: category
          description: Limit result set to products assigned a specific category.
          in: query
          required: false
          schema:
            type: string
        - name: type
          description: Limit result set to products assigned a specific type.
          in: query
          required: false
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: Get all costs.
      tags:
        - Costs
  /wp-json/mainwp/v2/costs/add:
    put:
      description: Adds a new Cost to MainWP Dashboard.
      operationId: addCost
      parameters:
        - name: name
          description: Cost name.
          in: query
          required: true
          schema:
            type: string
        - name: sites
          description: IDs of sites to assign to the cost.
          in: query
          required: false
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: Add new cost.
      tags:
        - Costs
  /wp-json/mainwp/v2/costs/{cost}:
    get:
      description: Retrieves inforomation about cost by ID.
      operationId: getCost
      parameters:
        - name: cost
          description: Cost ID.
          in: path
          required: true
          schema:
            type: integer
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: Get costs by ID.
      tags:
        - Costs
  /wp-json/mainwp/v2/costs/{cost}/edit:
    put:
      description: Updates cost data.
      operationId: edotCost
      parameters:
        - name: cost
          description: Cost ID.
          in: path
          required: true
          schema:
            type: integer
        - name: name
          description: The name of the cost.
          in: query
          required: false
          schema:
            type: string
        - name: sites
          description: IDs of Child Sites associated to the cost.
          in: query
          required: false
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: Modify cost info.
      tags:
        - Costs
  /wp-json/mainwp/v2/tags:
    get:
      description: Retreives information about Tags.
      operationId: getAllTags
      parameters:
        - name: page
          description: Current page of the collection.
          in: query
          required: false
          schema:
            type: integer
        - name: per_page
          description: Maximum number of items to be returned in result set.
          in: query
          required: false
          schema:
            type: integer
        - name: search
          description: Limit results to those matching a string - search in title name and URL.
          in: query
          required: false
          schema:
            type: string
        - name: exclude
          description: Ensure result set excludes specific IDs.
          in: query
          required: false
          schema:
            type: string
        - name: include
          description: Limit result set to specific IDs.
          in: query
          required: false
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: Get all tags.
      tags:
        - Tags
  /wp-json/mainwp/v2/updates:
    get:
      description: Retreives information about Updates.
      operationId: getAllUpdates
      parameters:
        - name: search
          description: Limit results to those matching a string - search in title name and URL.
          in: query
          required: false
          schema:
            type: string
        - name: exclude
          description: Ensure result set excludes specific IDs.
          in: query
          required: false
          schema:
            type: string
        - name: include
          description: Limit result set to specific IDs.
          in: query
          required: false
          schema:
            type: string
        - name: type
          description: Limit results to specific type.
          in: query
          required: false
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: Get all updates.
      tags:
        - Updates
  /wp-json/mainwp/v2/updates/{site}:
    get:
      description: Retreives information about Updates for a single site by site ID.
      operationId: getSiteUpdates
      parameters:
        - name: site
          description: Site ID or Domain.
          in: path
          required: true
          schema:
            type: string
        - name: search
          description: Limit results to those matching a string - search in title name and URL.
          in: query
          required: false
          schema:
            type: string
        - name: type
          description: Limit results to specific type, options are wp, plugins, themes , translations.
          in: query
          required: false
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: Get all updates for a site.
      tags:
        - Updates
  /wp-json/mainwp/v2/updates/{site}/update/wp:
    post:
      description: Update WordPress core on a single site.
      operationId: updateSiteWP
      parameters:
        - name: site
          description: Site ID or Domain.
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: Update WordPress core on a single sites.
      tags:
        - Updates
  /wp-json/mainwp/v2/updates/{site}/update/plugins:
    post:
      description: Update plugins on a single site.
      operationId: updateSitePlugins
      parameters:
        - name: site
          description: Site ID or Domain.
          in: path
          required: true
          schema:
            type: string
        - name: slug
          description: Plugin slug.
          in: query
          required: false
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: Update plugins on a single sites.
      tags:
        - Updates
  /wp-json/mainwp/v2/updates/{site}/update/themes:
    post:
      description: Update themes on a single site.
      operationId: updateSiteThemes
      parameters:
        - name: site
          description: Site ID or Domain.
          in: path
          required: true
          schema:
            type: string
        - name: slug
          description: Theme slug.
          in: query
          required: false
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
        "400":
          description: Bad request.
        "401":
          description: Authorization information is missing or invalid.
        "404":
          description: API endpoint was not found.
        5XX:
          description: Unexpected error.
      summary: Update themes on a single sites.
      tags:
        - Updates
components:
  schemas: {}
Still Have Questions?
Search for additional solutions in the MainWP Community or start your own discussion
MainWP Community

Table of Contents

Search MainWP.com

[searchwp_form id="1"]