> ## 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.

# Get Lock

> Check who holds the advisory lock on a resource.

Returns:
    Lock entry if resource is locked, None otherwise.



## OpenAPI

````yaml https://api.pragmatiks.io/openapi.json get /presence/locks/{resource_id}
openapi: 3.1.0
info:
  title: Pragma API
  version: 0.1.0
servers: []
security: []
paths:
  /presence/locks/{resource_id}:
    get:
      tags:
        - presence
        - presence
      summary: Get Lock
      description: |-
        Check who holds the advisory lock on a resource.

        Returns:
            Lock entry if resource is locked, None otherwise.
      operationId: presence-get_lock
      parameters:
        - name: resource_id
          in: path
          required: true
          schema:
            type: string
            title: Resource Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/LockEntry'
                  - type: 'null'
                title: Response Presence-Get Lock
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    LockEntry:
      properties:
        resource_id:
          type: string
          title: Resource Id
        agent_id:
          type: string
          title: Agent Id
        organization_id:
          type: string
          title: Organization Id
        acquired_at:
          type: string
          format: date-time
          title: Acquired At
      type: object
      required:
        - resource_id
        - agent_id
        - organization_id
      title: LockEntry
      description: |-
        Advisory lock on a resource.

        Attributes:
            resource_id: ID of the locked resource.
            agent_id: ID of the agent holding the lock.
            organization_id: Organization the lock belongs to.
            acquired_at: Timestamp when the lock was acquired.
    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
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````