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

# Set Node Pinned

> Toggle the pinned state for a single node.

Pinned nodes are excluded from auto-layout on the frontend.
If the node has no saved position, creates one at (0, 0) with
the requested pin state.

Returns:
    Complete set of saved positions after update.



## OpenAPI

````yaml https://api.pragmatiks.io/openapi.json put /canvas/positions/{resource_id}/pinned
openapi: 3.1.0
info:
  title: Pragma API
  version: 0.1.0
servers: []
security: []
paths:
  /canvas/positions/{resource_id}/pinned:
    put:
      tags:
        - canvas
      summary: Set Node Pinned
      description: |-
        Toggle the pinned state for a single node.

        Pinned nodes are excluded from auto-layout on the frontend.
        If the node has no saved position, creates one at (0, 0) with
        the requested pin state.

        Returns:
            Complete set of saved positions after update.
      operationId: canvas-set_node_pinned
      parameters:
        - name: resource_id
          in: path
          required: true
          schema:
            type: string
            title: Resource Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NodePinnedRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CanvasPositionsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    NodePinnedRequest:
      properties:
        pinned:
          type: boolean
          title: Pinned
      type: object
      required:
        - pinned
      title: NodePinnedRequest
      description: |-
        Request body for toggling a node's pinned state.

        Attributes:
            pinned: Whether the node should be excluded from auto-layout.
    CanvasPositionsResponse:
      properties:
        positions:
          additionalProperties:
            $ref: '#/components/schemas/NodePosition'
          type: object
          title: Positions
      type: object
      title: CanvasPositionsResponse
      description: |-
        Response body for canvas position queries.

        Attributes:
            positions: Map of resource ID to node position.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    NodePosition:
      properties:
        x:
          type: number
          title: X
        'y':
          type: number
          title: 'Y'
        pinned:
          type: boolean
          title: Pinned
          default: false
      type: object
      required:
        - x
        - 'y'
      title: NodePosition
      description: |-
        Position and pin state for a single node on the canvas.

        Attributes:
            x: Horizontal position in canvas coordinates.
            y: Vertical position in canvas coordinates.
            pinned: Whether the node is excluded from auto-layout.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````