Locks

Queue a lock for a resource

post

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.

Authorizations
Body
repositorystringRequired
resourcestringRequired
leaseDurationSecondsnumberRequired
Responses
201

Lock request queued successfully

post
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
}
201

Lock request queued successfully

No content

Get status of a specific lock

get

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.

Authorizations
Path parameters
repositorystringRequired
resourcestringRequired
ticketIdstringRequired
Responses
200

Lock status retrieved successfully

application/json
get
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"
}

Release a lock

delete

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.

Authorizations
Path parameters
repositorystringRequired
resourcestringRequired
ticketIdstringRequired
Responses
200

Lock released successfully

delete
DELETE /sfp/api/locks/{repository}/{resource}/{ticketId} HTTP/1.1
Host: 
Authorization: Bearer JWT
Accept: */*
200

Lock released successfully

No content

Get all locks for a resource

get

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.

Authorizations
Path parameters
repositorystringRequired
resourcestringRequired
Responses
200

Resource locks retrieved successfully

application/json
get
GET /sfp/api/locks/{repository}/{resource} HTTP/1.1
Host: 
Authorization: Bearer JWT
Accept: */*
200

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"
  }
]

Clear all locks for a resource

delete

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.

Authorizations
Path parameters
repositorystringRequired
resourcestringRequired
Responses
200

All locks cleared successfully

delete
DELETE /sfp/api/locks/{repository}/{resource} HTTP/1.1
Host: 
Authorization: Bearer JWT
Accept: */*
200

All locks cleared successfully

No content

Attempt to acquire a lock for a queued ticket

post

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.

Authorizations
Path parameters
repositorystringRequired
resourcestringRequired
ticketIdstringRequired
Responses
200

Lock acquisition attempt result

application/json
post
POST /sfp/api/locks/{repository}/{resource}/{ticketId}/acquire HTTP/1.1
Host: 
Authorization: Bearer JWT
Accept: */*
200

Lock acquisition attempt result

{
  "acquired": true,
  "message": "text"
}

Was this helpful?