Locks
Requests a lock on a specific resource within a repository. If the resource is already locked, the request is queued. Returns a ticket ID that can be used to check status, attempt acquisition, or release the lock. Locks automatically expire after the specified duration.
Lock request queued successfully
POST /sfp/api/locks HTTP/1.1
Host:
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 64
{
"repository": "text",
"resource": "text",
"leaseDurationSeconds": 1
}
Lock request queued successfully
No content
Retrieves the current status of a lock request by ticket ID. Returns information including lock status (queued/acquired/released), queue position if queued, lease start time and duration if acquired, and requestor details.
Lock status retrieved successfully
Lock not found
GET /sfp/api/locks/{repository}/{resource}/{ticketId} HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
{
"id": "text",
"resource": "text",
"ticketId": "text",
"status": "queued",
"queuePosition": 1,
"leaseStart": "2025-08-14T14:43:21.998Z",
"leaseDurationSeconds": 1,
"createdAt": "2025-08-14T14:43:21.998Z",
"updatedAt": "2025-08-14T14:43:21.998Z"
}
Releases a previously acquired lock using the ticket ID. Only the lock holder or users with owner/application role can release a lock. Once released, the next queued request (if any) will automatically acquire the lock.
Lock released successfully
DELETE /sfp/api/locks/{repository}/{resource}/{ticketId} HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
Lock released successfully
No content
Retrieves all lock requests (queued, acquired, and recently released) for a specific resource. Useful for understanding the current lock queue and identifying who holds the lock. Results are ordered by queue position for queued locks.
Resource locks retrieved successfully
GET /sfp/api/locks/{repository}/{resource} HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
Resource locks retrieved successfully
[
{
"id": "text",
"resource": "text",
"ticketId": "text",
"status": "queued",
"queuePosition": 1,
"leaseStart": "2025-08-14T14:43:21.998Z",
"leaseDurationSeconds": 1,
"createdAt": "2025-08-14T14:43:21.998Z",
"updatedAt": "2025-08-14T14:43:21.998Z"
}
]
Force clears all locks (both acquired and queued) for a specific resource. This is a destructive operation that should only be used for recovery scenarios. All waiting requests will be cancelled. Requires owner or application role.
All locks cleared successfully
DELETE /sfp/api/locks/{repository}/{resource} HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
All locks cleared successfully
No content
Attempts to acquire a previously queued lock. Returns immediately with the result. If the lock is still queued (another lock is active), returns acquired=false. If this lock is now at the front of the queue, it will be acquired and returns acquired=true. Use this endpoint to poll for lock availability.
Lock acquisition attempt result
POST /sfp/api/locks/{repository}/{resource}/{ticketId}/acquire HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
Lock acquisition attempt result
{
"acquired": true,
"message": "text"
}
Was this helpful?