Environments
Retrieves environments with optional filtering. Returns grouped by category when no specific category filter is provided, or a flat array when filtering by a specific category. Each environment includes current lock status and queue information.
Filter by repository identifier (e.g., owner/repo)
myorg/myrepo
Filter by environment category. When specified, returns a flat array of that category only.
Filter by active status
true
Filter by git branch
main
List of environments with lock status. Returns GroupedEnvironmentsDto when no category filter, or EnvironmentDto[] when category is specified. Each environment includes isLocked, lockedBy, lockExpiresAt, lockExpiresInSeconds, and detailed lockStatus object.
GET /sfp/api/environments HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
List of environments with lock status. Returns GroupedEnvironmentsDto when no category filter, or EnvironmentDto[] when category is specified. Each environment includes isLocked, lockedBy, lockExpiresAt, lockExpiresInSeconds, and detailed lockStatus object.
{
"dev": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"repositoryIdentifier": "myorg/myrepo",
"repositoryName": "myrepo",
"name": "dev1",
"description": "Development environment",
"category": "dev",
"salesforceUsername": "[email protected]",
"devHubUsername": null,
"isActive": true,
"isDefault": false,
"isLocked": false,
"lockedBy": null,
"lockExpiresAt": null,
"lockExpiresInSeconds": null,
"lockStatus": {
"isLocked": false,
"currentLock": null,
"queuedLocks": []
},
"metadata": {},
"tags": [
"development"
],
"branch": "develop",
"orchestrationOrder": null,
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
],
"test": [
{
"id": "223e4567-e89b-12d3-a456-426614174000",
"repositoryIdentifier": "myorg/myrepo",
"repositoryName": "myrepo",
"name": "test1",
"description": "Test environment",
"category": "test",
"salesforceUsername": "[email protected]",
"devHubUsername": null,
"isActive": true,
"isDefault": false,
"isLocked": true,
"lockedBy": "ci-pipeline",
"lockExpiresAt": "2024-01-15T15:00:00Z",
"lockExpiresInSeconds": 3600,
"lockStatus": {
"isLocked": true,
"currentLock": {
"lockedBy": "ci-pipeline",
"lockReason": "Running integration tests",
"expiresAt": "2024-01-15T15:00:00Z",
"expiresInSeconds": 3600
},
"queuedLocks": [
{
"position": 1,
"requestedBy": "deploy-bot",
"lockReason": "Deployment to test",
"estimatedWaitSeconds": 3600,
"ticketId": "ticket_456def"
}
]
},
"metadata": {
"tier": "sandbox"
},
"tags": [
"testing",
"automated"
],
"branch": "develop",
"orchestrationOrder": null,
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-15T14:00:00Z"
}
],
"snapshot": [],
"release": [
{
"id": "323e4567-e89b-12d3-a456-426614174000",
"repositoryIdentifier": "myorg/myrepo",
"repositoryName": "myrepo",
"name": "prod",
"description": "Production environment",
"category": "release",
"salesforceUsername": "[email protected]",
"devHubUsername": null,
"isActive": true,
"isDefault": true,
"isLocked": false,
"lockedBy": null,
"lockExpiresAt": null,
"lockExpiresInSeconds": null,
"lockStatus": {
"isLocked": false,
"currentLock": null,
"queuedLocks": []
},
"metadata": {
"region": "us-west",
"tier": "enterprise"
},
"tags": [
"critical",
"monitored"
],
"branch": "main",
"orchestrationOrder": 1,
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
]
}
Creates a new environment linked to a repository and Salesforce org. The environment can be locked using the mutex system for exclusive access.
Environment created successfully with lock status information
{"id":"456e7890-e89b-12d3-a456-426614174001","repositoryIdentifier":"myorg/myrepo","repositoryName":"myrepo","name":"prod","description":"Production environment","category":"release","salesforceUsername":"[email protected]","devHubUsername":null,"isActive":true,"isDefault":true,"isLocked":false,"lockedBy":null,"lockExpiresAt":null,"lockExpiresInSeconds":null,"lockStatus":{"isLocked":false,"currentLock":null,"queuedLocks":[]},"metadata":{"region":"us-west","tier":"enterprise"},"tags":["critical","monitored"],"branch":"main","orchestrationOrder":null,"createdAt":"2024-01-01T00:00:00Z","updatedAt":"2024-01-01T00:00:00Z","createdBy":"[email protected]","updatedBy":"[email protected]"}
Bad request
Repository or Salesforce org not found
Environment already exists or Salesforce username already registered
POST /sfp/api/environments HTTP/1.1
Host:
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 287
{
"repositoryIdentifier": "myorg/myrepo",
"name": "prod",
"description": "Production environment",
"category": "release",
"salesforceUsername": "[email protected]",
"isActive": true,
"isDefault": true,
"metadata": {
"region": "us-west",
"tier": "enterprise"
},
"tags": [
"critical",
"monitored"
],
"branch": "main"
}
{
"id": "456e7890-e89b-12d3-a456-426614174001",
"repositoryIdentifier": "myorg/myrepo",
"repositoryName": "myrepo",
"name": "prod",
"description": "Production environment",
"category": "release",
"salesforceUsername": "[email protected]",
"devHubUsername": null,
"isActive": true,
"isDefault": true,
"isLocked": false,
"lockedBy": null,
"lockExpiresAt": null,
"lockExpiresInSeconds": null,
"lockStatus": {
"isLocked": false,
"currentLock": null,
"queuedLocks": []
},
"metadata": {
"region": "us-west",
"tier": "enterprise"
},
"tags": [
"critical",
"monitored"
],
"branch": "main",
"orchestrationOrder": null,
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z",
"createdBy": "[email protected]",
"updatedBy": "[email protected]"
}
Retrieves the deployment orchestration order for environments within a specific category in a repository. Returns an ordered array of environment names.
Repository identifier (e.g., owner/repo)
myorg/myrepo
Environment category
Ordered array of environment names
["dev1","dev2","dev3"]
Bad request - missing required parameters
GET /sfp/api/environments/orchestration-order?repositoryIdentifier=myorg%2Fmyrepo&category=dev&includeInactive=text HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
[
"dev1",
"dev2",
"dev3"
]
Updates the deployment orchestration order for environments within a specific category in a repository. Replaces the entire order with the provided array.
Repository identifier (e.g., owner/repo)
myorg/myrepo
Environment category
Updated orchestration order
["dev3","dev1","dev2"]
Bad request - missing parameters or invalid environment names
PUT /sfp/api/environments/orchestration-order?repositoryIdentifier=myorg%2Fmyrepo&category=dev&includeInactive=text HTTP/1.1
Host:
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 43
{
"environmentOrder": [
"dev1",
"dev2",
"dev3"
]
}
[
"dev3",
"dev1",
"dev2"
]
Retrieves detailed information about a specific environment by its name and repository identifier
Environment name
production
Repository identifier (e.g., owner/repo)
myorg/myrepo
Include SFDX auth URL in response (requires owner/application role)
Environment details
Environment not found
GET /sfp/api/environments/by-name/{name}?repositoryIdentifier=myorg%2Fmyrepo HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
No content
Permanently deletes an environment by name and repository. Cannot delete a locked environment.
Environment name
production
Repository identifier (e.g., owner/repo)
myorg/myrepo
Environment deleted successfully
Environment not found
Cannot delete locked environment
DELETE /sfp/api/environments/by-name/{name}?repositoryIdentifier=myorg%2Fmyrepo HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
No content
Updates environment properties by name and repository. Only provided fields will be updated.
Environment name
production
Repository identifier (e.g., owner/repo)
myorg/myrepo
Environment updated successfully
Environment or Salesforce org not found
Environment name already exists
PATCH /sfp/api/environments/by-name/{name}?repositoryIdentifier=myorg%2Fmyrepo HTTP/1.1
Host:
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 6
"text"
No content
Retrieves detailed information about a specific environment including its lock status
Environment ID
456e7890-e89b-12d3-a456-426614174001
Include SFDX auth URL in response (requires owner/application role)
Environment details
{"id":"456e7890-e89b-12d3-a456-426614174001","repositoryIdentifier":"myorg/my-salesforce-project","repositoryName":"my-salesforce-project","name":"prod","description":"Production environment","category":"release","salesforceUsername":"[email protected]","isActive":true,"isDefault":true,"isLocked":true,"lockedBy":"deploy-bot","metadata":{"region":"us-west","tier":"enterprise"},"tags":["critical","monitored"],"branch":"main","createdAt":"2024-01-01T00:00:00Z","updatedAt":"2024-01-15T12:00:00Z","createdBy":"user123","updatedBy":"user456"}
Environment not found
GET /sfp/api/environments/{id} HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
{
"id": "456e7890-e89b-12d3-a456-426614174001",
"repositoryIdentifier": "myorg/my-salesforce-project",
"repositoryName": "my-salesforce-project",
"name": "prod",
"description": "Production environment",
"category": "release",
"salesforceUsername": "[email protected]",
"isActive": true,
"isDefault": true,
"isLocked": true,
"lockedBy": "deploy-bot",
"metadata": {
"region": "us-west",
"tier": "enterprise"
},
"tags": [
"critical",
"monitored"
],
"branch": "main",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-15T12:00:00Z",
"createdBy": "user123",
"updatedBy": "user456"
}
Permanently deletes an environment. Cannot delete a locked environment. All associated tags and audit records will be deleted.
Environment ID
456e7890-e89b-12d3-a456-426614174001
Environment deleted successfully
Environment not found
Cannot delete locked environment
DELETE /sfp/api/environments/{id} HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
No content
Updates environment properties. Only provided fields will be updated. Changing salesforceUsername will validate the new org exists.
Environment ID
456e7890-e89b-12d3-a456-426614174001
Environment updated successfully with current lock status
{"id":"456e7890-e89b-12d3-a456-426614174001","repositoryIdentifier":"myorg/myrepo","repositoryName":"myrepo","name":"prod","description":"Updated production environment","category":"release","salesforceUsername":"[email protected]","devHubUsername":null,"isActive":true,"isDefault":true,"isLocked":false,"lockedBy":null,"lockExpiresAt":null,"lockExpiresInSeconds":null,"lockStatus":{"isLocked":false,"currentLock":null,"queuedLocks":[]},"metadata":{"region":"us-west","tier":"enterprise"},"tags":["production","critical","monitored"],"branch":"main","orchestrationOrder":1,"createdAt":"2024-01-01T00:00:00Z","updatedAt":"2024-01-15T16:00:00Z","createdBy":"[email protected]","updatedBy":"[email protected]"}
Environment or Salesforce org not found
Environment name already exists or Salesforce username conflict
PATCH /sfp/api/environments/{id} HTTP/1.1
Host:
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 46
{
"tags": [
"production",
"critical",
"monitored"
]
}
{
"id": "456e7890-e89b-12d3-a456-426614174001",
"repositoryIdentifier": "myorg/myrepo",
"repositoryName": "myrepo",
"name": "prod",
"description": "Updated production environment",
"category": "release",
"salesforceUsername": "[email protected]",
"devHubUsername": null,
"isActive": true,
"isDefault": true,
"isLocked": false,
"lockedBy": null,
"lockExpiresAt": null,
"lockExpiresInSeconds": null,
"lockStatus": {
"isLocked": false,
"currentLock": null,
"queuedLocks": []
},
"metadata": {
"region": "us-west",
"tier": "enterprise"
},
"tags": [
"production",
"critical",
"monitored"
],
"branch": "main",
"orchestrationOrder": 1,
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-15T16:00:00Z",
"createdBy": "[email protected]",
"updatedBy": "[email protected]"
}
Requests a lock on an environment. Returns a ticket ID immediately. The lock is queued if the environment is already locked. Use the /acquire endpoint with the ticket ID to wait for and obtain the actual lock. The lock will automatically expire after the specified duration.
Environment ID
456e7890-e89b-12d3-a456-426614174001
Repository name for mutex resource key
my-salesforce-project
Environment locked successfully
Missing repositoryName parameter
Environment not found
POST /sfp/api/environments/{id}/lock?repositoryName=my-salesforce-project HTTP/1.1
Host:
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 65
{
"leaseDurationSeconds": 3600,
"reason": "Deploying release v2.1.0"
}
{
"ticketId": "ticket_789abc12-3def-4567-8901-234567890abc"
}
Attempts to acquire a lock that was previously requested. This endpoint will wait up to the specified timeout for the lock to become available. Returns immediately if the lock is already acquired. Returns Salesforce credentials only when the lock is successfully acquired.
Environment ID
456e7890-e89b-12d3-a456-426614174001
Lock ticket ID obtained when requesting the lock
ticket_789abc12-3def-4567-8901-234567890abc
Repository name for mutex resource key
my-salesforce-project
Lock acquired successfully with sensitive credentials
Ticket not found or expired
Timeout waiting for lock acquisition
PUT /sfp/api/environments/{id}/lock/{ticketId}/acquire?repositoryName=my-salesforce-project HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
{
"status": "acquired",
"environmentId": "456e7890-e89b-12d3-a456-426614174001",
"environmentName": "production",
"salesforceUsername": "[email protected]",
"sfdxAuthUrl": "force://PlatformCLI::...",
"frontDoorUrl": "https://mycompany.my.salesforce.com/secur/frontdoor.jsp?sid=..."
}
Releases a lock on an environment using the ticket ID obtained when locking. Only the lock holder can release it unless admin/owner role.
Environment ID
456e7890-e89b-12d3-a456-426614174001
Lock ticket ID obtained when locking
ticket_789abc12-3def-4567-8901-234567890abc
Repository name for mutex resource key
my-salesforce-project
Environment unlocked successfully
Missing repositoryName parameter
Environment or lock not found
DELETE /sfp/api/environments/{id}/lock/{ticketId}?repositoryName=my-salesforce-project HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
No content
Requests a lock on an environment. Returns a ticket ID immediately. The lock is queued if the environment is already locked. Use the /acquire endpoint with the ticket ID to wait for and obtain the actual lock. The lock will automatically expire after the specified duration.
Environment name
production
Repository identifier (owner/repo)
myorg/myrepo
Environment locked successfully
Bad request
Environment not found
POST /sfp/api/environments/by-name/{name}/lock?repositoryIdentifier=myorg%2Fmyrepo HTTP/1.1
Host:
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 63
{
"leaseDurationMinutes": 60,
"reason": "Deploying release v2.1.0"
}
{
"ticketId": "ticket_789abc12-3def-4567-8901-234567890abc"
}
Attempts to acquire a lock that was previously requested. This endpoint will wait up to the specified timeout for the lock to become available. Returns immediately if the lock is already acquired. Returns Salesforce credentials only when the lock is successfully acquired.
Environment name
production
Lock ticket ID obtained when requesting the lock
ticket_789abc12-3def-4567-8901-234567890abc
Repository identifier (owner/repo)
myorg/myrepo
Lock acquired successfully with sensitive credentials
Environment or ticket not found
Timeout waiting for lock acquisition
PUT /sfp/api/environments/by-name/{name}/lock/{ticketId}/acquire?repositoryIdentifier=myorg%2Fmyrepo HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
{
"status": "acquired",
"environmentId": "456e7890-e89b-12d3-a456-426614174001",
"environmentName": "production",
"salesforceUsername": "[email protected]",
"sfdxAuthUrl": "force://PlatformCLI::...",
"frontDoorUrl": "https://mycompany.my.salesforce.com/secur/frontdoor.jsp?sid=..."
}
Releases a lock on an environment using repository identifier, environment name, and ticket ID.
Environment name
production
Lock ticket ID obtained when locking
ticket_789abc12-3def-4567-8901-234567890abc
Repository identifier (owner/repo)
myorg/myrepo
Environment unlocked successfully
Bad request
Environment not found
DELETE /sfp/api/environments/by-name/{name}/lock/{ticketId}?repositoryIdentifier=myorg%2Fmyrepo HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
No content
Retrieves audit logs for all access to this environment including reads, updates, locks, and frontdoor access
Environment ID
456e7890-e89b-12d3-a456-426614174001
Maximum number of audit records to return (default: 100)
50
Environment access audit logs
[{"id":"audit123","environment_id":"456e7890-e89b-12d3-a456-426614174001","repository_identifier":"myorg/myrepo","accessed_by":"user123","accessed_by_application":null,"access_type":"lock","access_details":{"action":"environment_locked","ticket_id":"ticket_789abc","duration_seconds":3600,"reason":"Deployment in progress"},"ip_address":"192.168.1.100","user_agent":"Mozilla/5.0...","accessed_at":"2024-01-15T14:30:00Z"}]
GET /sfp/api/environments/{id}/audit?accessType=text&offset=1 HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
Environment access audit logs
[
{
"id": "audit123",
"environment_id": "456e7890-e89b-12d3-a456-426614174001",
"repository_identifier": "myorg/myrepo",
"accessed_by": "user123",
"accessed_by_application": null,
"access_type": "lock",
"access_details": {
"action": "environment_locked",
"ticket_id": "ticket_789abc",
"duration_seconds": 3600,
"reason": "Deployment in progress"
},
"ip_address": "192.168.1.100",
"user_agent": "Mozilla/5.0...",
"accessed_at": "2024-01-15T14:30:00Z"
}
]
Repository identifier (e.g., owner/repo)
Maximum number of audit records (default: 100)
Repository environment access audit logs
GET /sfp/api/environments/repository/{repositoryIdentifier}/audit?accessType=text&offset=1 HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
Repository environment access audit logs
[]
Generates a Salesforce frontdoor URL for the environment's org. Can either return the URL or redirect directly to Salesforce. Access is audited.
Environment ID
456e7890-e89b-12d3-a456-426614174001
Whether to redirect to Salesforce (default: true) or return the URL (false)
false
Frontdoor URL retrieved (when redirect=false)
Redirect to Salesforce (when redirect=true)
Unable to generate frontdoor URL
Environment not found
GET /sfp/api/environments/{id}/frontdoor HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
{
"url": "https://mycompany.my.salesforce.com/secur/frontdoor.jsp?sid=00D...&retURL=%2F"
}
Retrieves all artifacts installed in the Salesforce org associated with this environment. Results are cached for 1 hour unless force refresh is requested.
Environment ID (UUID)
123e4567-e89b-12d3-a456-426614174000
Force refresh the cached data
List of installed artifacts retrieved successfully
Unable to retrieve artifacts (e.g., authentication error)
Environment not found
GET /sfp/api/environments/{id}/artifacts HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
{
"environmentId": "text",
"environmentName": "text",
"salesforceUsername": "text",
"artifacts": [
{
"name": "text",
"version": "text",
"commitId": "text",
"subscriberVersion": "text",
"type": "text",
"isInstalledBysfp": true
}
],
"retrievedAt": "2025-08-14T14:43:22.716Z",
"cached": true
}
Retrieves all artifacts installed in the Salesforce org associated with this environment by name. Results are cached for 1 hour unless force refresh is requested.
Environment name
production
Repository identifier (e.g., owner/repo)
myorg/myrepo
Force refresh the cached data
List of installed artifacts retrieved successfully
Unable to retrieve artifacts (e.g., authentication error)
Environment not found
GET /sfp/api/environments/by-name/{name}/artifacts?repositoryIdentifier=myorg%2Fmyrepo HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
{
"environmentId": "text",
"environmentName": "text",
"salesforceUsername": "text",
"artifacts": [
{
"name": "text",
"version": "text",
"commitId": "text",
"subscriberVersion": "text",
"type": "text",
"isInstalledBysfp": true
}
],
"retrievedAt": "2025-08-14T14:43:22.716Z",
"cached": true
}
Retrieves all releases that have been deployed to a specific environment. Releases are sorted by publication date with the most recent first.
You can optionally filter releases by domain (release configuration) and paginate through results.
This endpoint returns release metadata that was captured during the release process, including:
- Release name and domain
- Publication timestamp
- Repository information
- Any additional metadata from the release
Returns an empty list if no releases have been recorded for the environment.
Environment ID (UUID)
Filter releases by domain/release configuration name
core
Maximum number of releases to return
50
Number of releases to skip for pagination
0
Releases retrieved successfully
Environment not found
GET /sfp/api/environments/{id}/releases HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
{
"environmentId": "123e4567-e89b-12d3-a456-426614174000",
"environmentName": "production",
"repositoryIdentifier": "myorg/myrepo",
"releases": [
{
"name": "v1.2.3",
"domain": "core",
"targetOrg": "production",
"publishedAt": "2024-01-15T10:30:00.000Z",
"repoIdentifier": "myorg/myrepo",
"metadata": {}
}
],
"totalCount": 100,
"limit": 50,
"offset": 0,
"retrievedAt": "2024-01-15T10:30:00.000Z"
}
Retrieves all releases for an environment identified by its name and repository. This is a convenience endpoint that works the same as the ID-based endpoint.
See GET /environments/:id/releases for full documentation.
Environment name
Repository identifier in format owner/repo
myorg/myrepo
Filter releases by domain/release configuration name
core
Maximum number of releases to return
50
Number of releases to skip for pagination
0
Releases retrieved successfully
Missing or invalid parameters
Environment not found
GET /sfp/api/environments/by-name/{name}/releases?repositoryIdentifier=myorg%2Fmyrepo HTTP/1.1
Host:
Authorization: Bearer JWT
Accept: */*
{
"environmentId": "123e4567-e89b-12d3-a456-426614174000",
"environmentName": "production",
"repositoryIdentifier": "myorg/myrepo",
"releases": [
{
"name": "v1.2.3",
"domain": "core",
"targetOrg": "production",
"publishedAt": "2024-01-15T10:30:00.000Z",
"repoIdentifier": "myorg/myrepo",
"metadata": {}
}
],
"totalCount": 100,
"limit": 50,
"offset": 0,
"retrievedAt": "2024-01-15T10:30:00.000Z"
}
Was this helpful?