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

# Update a pin

> Update the placement of a pin.



## OpenAPI

````yaml https://api.tembo.io/public-api/openapi/public patch /v1/pins/{resourceType}/{resourceId}
openapi: 3.1.0
info:
  title: Tembo Public API
  description: >-
    Manage agents, sessions, repositories, and organization resources with the
    Tembo API.
  version: 1.0.0
servers:
  - url: https://api.tembo.io
    description: Tembo API
  - url: https://{deployment-origin}/api/public-api
    description: Self-hosted Tembo
    variables:
      deployment-origin:
        default: tembo.example.com
        description: Hostname of your self-hosted Tembo deployment
security: []
paths:
  /v1/pins/{resourceType}/{resourceId}:
    patch:
      tags:
        - Pins
      summary: Update a pin
      description: Update the placement of a pin.
      operationId: updatePin
      parameters:
        - in: path
          name: resourceType
          schema:
            type: string
            enum:
              - session
              - pull_request
              - project
          required: true
        - in: path
          name: resourceId
          schema:
            type: string
            format: uuid
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                placement:
                  type: object
                  properties:
                    target:
                      type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - session
                            - pull_request
                            - project
                        id:
                          type: string
                          format: uuid
                      required:
                        - type
                        - id
                      additionalProperties: false
                    position:
                      type: string
                      enum:
                        - before
                        - after
                  required:
                    - target
                    - position
                  additionalProperties: false
              required:
                - placement
              additionalProperties: false
      responses:
        '200':
          description: Update a pin
          content:
            application/json:
              schema:
                type: object
                properties:
                  updated:
                    type: boolean
                required:
                  - updated
                additionalProperties: false
        '400':
          description: Validation error or missing caller scope
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '409':
          description: Pin limit reached
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '500':
          description: Pin operation failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
      security:
        - apiKey: []
      x-codeSamples:
        - lang: typescript
          label: TypeScript SDK
          source: >
            import Tembo from '@tembo-io/sdk';


            const client = new Tembo();


            const pin = await
            client.pins.update('7c9e6679-7425-40de-944b-e07fc1f90ae7', {
              resourceType: 'session',
              placement: {
                target: {
                  type: 'session',
                  id: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
                },
                position: 'before',
              },
            });
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````

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