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

# Acquire Update Lock

> Acquire an update lock for coordinated rolling updates.

This ensures only one worker in a queue updates at a time.
Uses Redis for distributed locking with automatic TTL expiration.

Args:
    queue_id: Worker queue ID
    worker_id: Worker ID requesting the lock
    lock_request: Lock configuration (duration)

Returns:
    Lock information if acquired, or error if another worker holds the lock



## OpenAPI

````yaml https://control-plane.kubiya.ai/api/openapi.json post /api/v1/worker-queues/{queue_id}/workers/{worker_id}/update-lock
openapi: 3.1.0
info:
  title: Agent Control Plane API
  description: Multi-tenant agent orchestration with Temporal workflows
  version: 1.0.0
servers: []
security:
  - BearerAuth: []
tags:
  - name: health
    description: 🏥 **Health & Status** - Check API health and availability
  - name: authentication
    description: 🔐 **Authentication** - Token validation and auth management
  - name: agents
    description: 🤖 **Agents** - Create and manage AI agents with custom capabilities
  - name: skills
    description: 🛠️ **Tool Sets** - Manage agent skills and tool configurations
  - name: integrations
    description: 🔌 **Integrations** - Connect to external services (Kubiya managed)
  - name: custom-integrations
    description: >-
      ⚙️ **Custom Integrations** - User-defined integration instances with env
      vars, secrets, and files
  - name: integration-templates
    description: >-
      📦 **Integration Templates** - Pre-configured templates for common
      services (PostgreSQL, Redis, MongoDB, etc.)
  - name: secrets
    description: 🔑 **Secrets** - Secure credential storage and retrieval
  - name: teams
    description: 👥 **Teams** - Team management and collaboration
  - name: workflows
    description: 📊 **Workflows** - Multi-step automation and orchestration
  - name: executions
    description: ▶️ **Executions** - Track and monitor workflow runs
  - name: jobs
    description: ⏰ **Jobs** - Scheduled and webhook-triggered tasks
  - name: policies
    description: 🛡️ **Policies** - Access control and security policies
  - name: analytics
    description: 📈 **Analytics** - Usage metrics and performance monitoring
  - name: projects
    description: 📁 **Projects** - Project organization and management
  - name: environments
    description: 🌍 **Environments** - Environment configuration (dev, staging, prod)
  - name: models
    description: 🧠 **Models** - LLM model configuration and management
  - name: runtimes
    description: ⚡ **Runtimes** - Agent execution runtime environments
  - name: workers
    description: 👷 **Workers** - Worker registration and heartbeat monitoring
  - name: storage
    description: 💾 **Storage** - File storage and cloud integration
  - name: context-graph
    description: 🕸️ **Context Graph** - Knowledge graph and context management
  - name: temporal-workflows
    description: >-
      ⚙️ **Temporal Workflows** - Background workflows for context graph
      ingestion, connector operations, and scheduled jobs
  - name: templates
    description: 📝 **Templates** - Reusable configuration templates
paths:
  /api/v1/worker-queues/{queue_id}/workers/{worker_id}/update-lock:
    post:
      summary: Acquire Update Lock
      description: |-
        Acquire an update lock for coordinated rolling updates.

        This ensures only one worker in a queue updates at a time.
        Uses Redis for distributed locking with automatic TTL expiration.

        Args:
            queue_id: Worker queue ID
            worker_id: Worker ID requesting the lock
            lock_request: Lock configuration (duration)

        Returns:
            Lock information if acquired, or error if another worker holds the lock
      operationId: >-
        acquire_update_lock_api_v1_worker_queues__queue_id__workers__worker_id__update_lock_post
      parameters:
        - name: queue_id
          in: path
          required: true
          schema:
            type: string
            title: Queue Id
        - name: worker_id
          in: path
          required: true
          schema:
            type: string
            title: Worker Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateLockRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateLockResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UpdateLockRequest:
      properties:
        worker_id:
          type: string
          title: Worker Id
        lock_duration_seconds:
          type: integer
          maximum: 600
          minimum: 60
          title: Lock Duration Seconds
          description: Lock TTL (60-600 seconds)
          default: 300
      type: object
      required:
        - worker_id
      title: UpdateLockRequest
      description: Request to acquire an update lock for coordinated rolling updates
    UpdateLockResponse:
      properties:
        lock_id:
          type: string
          title: Lock Id
        worker_id:
          type: string
          title: Worker Id
        queue_id:
          type: string
          title: Queue Id
        acquired_at:
          type: string
          title: Acquired At
        expires_at:
          type: string
          title: Expires At
        locked:
          type: boolean
          title: Locked
      type: object
      required:
        - lock_id
        - worker_id
        - queue_id
        - acquired_at
        - expires_at
        - locked
      title: UpdateLockResponse
      description: Response with update lock information
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Enter your Kubiya API token (format: Bearer <token>)'

````