Microsoft Visio API Shapes API

Operations for accessing and managing shapes on a Visio page

Operations 3

GET /document/pages/{pageName}/shapes List Shapes #
GET /document/pages/{pageName}/shapes/{shapeId} Get Shape #
PATCH /document/pages/{pageName}/shapes/{shapeId}/view Update Shape View #

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/visio-shapes-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

visio-shapes-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Visio JavaScript Shapes API
  description: The Visio JavaScript API enables building Office Add-ins that interact with Visio diagrams embedded in classic SharePoint Online pages.
  version: '1.1'
  contact:
    name: Microsoft Office Dev
    url: https://developer.microsoft.com/office
    email: officedevfeedback@microsoft.com
  license:
    name: Microsoft APIs Terms of Use
    url: https://learn.microsoft.com/en-us/legal/microsoft-apis/terms-of-use
  termsOfService: https://www.microsoft.com/en-us/legal/terms-of-use
servers:
- url: https://appsforoffice.microsoft.com/embedded/1.0
  description: Visio Office Add-ins embedded endpoint
security:
- EmbeddedSession: []
tags:
- name: Shapes
  description: Operations for accessing and managing shapes on a Visio page
paths:
  /document/pages/{pageName}/shapes:
    get:
      operationId: listShapes
      summary: List Shapes
      description: Returns all shapes on the specified Visio page. Each shape includes its name, text, ID, selection state, bounding box, and associated data.
      tags:
      - Shapes
      parameters:
      - name: pageName
        in: path
        required: true
        description: Name of the Visio page
        schema:
          type: string
      responses:
        '200':
          description: Collection of shapes
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShapeCollection'
        '404':
          description: Page not found
        '500':
          description: Internal server error
  /document/pages/{pageName}/shapes/{shapeId}:
    get:
      operationId: getShape
      summary: Get Shape
      description: Returns a specific shape on the Visio page identified by its shape ID. Includes shape text, data items, hyperlinks, and visual view properties.
      tags:
      - Shapes
      parameters:
      - name: pageName
        in: path
        required: true
        description: Name of the Visio page
        schema:
          type: string
      - name: shapeId
        in: path
        required: true
        description: Numeric ID of the shape
        schema:
          type: integer
      responses:
        '200':
          description: Shape object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Shape'
        '404':
          description: Shape not found
        '500':
          description: Internal server error
  /document/pages/{pageName}/shapes/{shapeId}/view:
    patch:
      operationId: updateShapeView
      summary: Update Shape View
      description: Updates the visual presentation of a shape, including highlight color, tooltip text, and overlay content for the specified shape.
      tags:
      - Shapes
      parameters:
      - name: pageName
        in: path
        required: true
        description: Name of the Visio page
        schema:
          type: string
      - name: shapeId
        in: path
        required: true
        description: Numeric ID of the shape
        schema:
          type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ShapeViewUpdate'
      responses:
        '200':
          description: Updated shape view
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShapeView'
        '404':
          description: Shape not found
        '500':
          description: Internal server error
components:
  schemas:
    Shape:
      type: object
      description: Represents a shape element on a Visio page
      properties:
        id:
          type: integer
          description: Numeric shape identifier
        name:
          type: string
          description: Name of the shape
        text:
          type: string
          description: Text content displayed inside the shape
        select:
          type: boolean
          description: Whether this shape is currently selected by the user
        view:
          $ref: '#/components/schemas/ShapeView'
        shapeDataItems:
          $ref: '#/components/schemas/ShapeDataItemCollection'
        hyperlinks:
          $ref: '#/components/schemas/HyperlinkCollection'
        comments:
          $ref: '#/components/schemas/CommentCollection'
        boundingBox:
          $ref: '#/components/schemas/BoundingBox'
    ShapeDataItemCollection:
      type: object
      description: Collection of data items associated with a shape
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ShapeDataItem'
    CommentCollection:
      type: object
      description: Collection of comments on a shape
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/Comment'
    ShapeCollection:
      type: object
      description: A collection of shapes on a Visio page
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/Shape'
    Hyperlink:
      type: object
      description: A hyperlink attached to a Visio shape
      properties:
        address:
          type: string
          description: URL or file path the hyperlink points to
        description:
          type: string
          description: Display description for the hyperlink
        subAddress:
          type: string
          description: Sub-address within the target (e.g. page name)
        extraInfo:
          type: string
          description: Additional information passed with the URL
    BoundingBox:
      type: object
      description: Bounding box coordinates of a shape
      properties:
        x:
          type: number
          description: X coordinate of the top-left corner
        y:
          type: number
          description: Y coordinate of the top-left corner
        width:
          type: number
          description: Width of the bounding box
        height:
          type: number
          description: Height of the bounding box
    HyperlinkCollection:
      type: object
      description: Collection of hyperlinks on a shape
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/Hyperlink'
    Comment:
      type: object
      description: A comment associated with a Visio shape
      properties:
        author:
          type: string
          description: Name of the comment author
        date:
          type: string
          format: date-time
          description: Timestamp when the comment was created
        text:
          type: string
          description: Content of the comment
    Highlight:
      type: object
      description: Highlight decoration applied to a shape
      properties:
        color:
          type: string
          description: CSS color string for the highlight (e.g.
        width:
          type: integer
          description: Width of the highlight border in points
    ShapeView:
      type: object
      description: Visual presentation settings for a shape
      properties:
        highlight:
          $ref: '#/components/schemas/Highlight'
        tooltip:
          type: string
          description: Tooltip text shown on hover
    ShapeDataItem:
      type: object
      description: A structured data item (label-value pair) associated with a shape
      properties:
        label:
          type: string
          description: Label or key for the data item
        value:
          type: string
          description: Value associated with the label
        format:
          type: string
          description: Optional display format for the value
        formattedValue:
          type: string
          description: Value after applying the format string
    ShapeViewUpdate:
      type: object
      description: Partial update to shape view settings
      properties:
        highlight:
          $ref: '#/components/schemas/Highlight'
        tooltip:
          type: string
          description: New tooltip text for the shape
  securitySchemes:
    EmbeddedSession:
      type: apiKey
      in: header
      name: X-Embedded-Session
      description: Visio EmbeddedSession token obtained via OfficeExtension.EmbeddedSession initialization
externalDocs:
  description: Visio JavaScript API Documentation
  url: https://learn.microsoft.com/en-us/office/dev/add-ins/visio/visio-overview