Orgs

Register or update a Salesforce org

post

Registers a new Salesforce organization or updates an existing one.

      Requirements:
      - sfdxAuthUrl is required (Generate using: sf org:display -u [email protected] --verbose --json)
      - The connection is validated before registration
      - instanceUrl is optional and will be extracted from sfdxAuthUrl if not provided
      
      Optional fields:
      - isDevHub: Mark this org as a DevHub (default: false)
      - isDefault: Mark this as the default DevHub - only one org can have this set (default: false)
      - metadata: Additional metadata as key-value pairs in JSON format
      
      If an org with the same username exists, it will be updated.
      
      For sandbox registrations without sfdxAuthUrl, use /auth/salesforce/register-sandbox-by-name instead.
Authorizations
Body
instanceUrlstringOptional

Instance URL of the Salesforce org (will be extracted from sfdxAuthUrl if not provided)

Example: https://mycompany.my.salesforce.comPattern: https://*.salesforce.com
usernamestringRequired

Username of the Salesforce integration user

Example: [email protected]
sfdxAuthUrlstringRequired

SFDX Auth URL (generated using sf org:display -u [email protected] --verbose --json)

Example: force://CLIENT_ID:CLIENT_SECRET:[email protected]
isDevHubbooleanOptional

Whether this org is a DevHub

Default: false
isDefaultbooleanOptional

Whether this is the default DevHub (only one org can have this set to true)

Default: false
metadataobjectOptional

Additional metadata stored as key-value pairs

Example: {"environment":"production","region":"us-west"}
Responses
201

Organization successfully registered/updated

application/json
post
POST /sfp/api/auth/salesforce/register HTTP/1.1
Host: 
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 277

{
  "instanceUrl": "https://mycompany.my.salesforce.com",
  "username": "[email protected]",
  "sfdxAuthUrl": "force://CLIENT_ID:CLIENT_SECRET:[email protected]",
  "isDevHub": false,
  "isDefault": false,
  "metadata": {
    "environment": "production",
    "region": "us-west"
  }
}
{
  "username": "text",
  "instanceUrl": "text",
  "orgId": "00D1a000000xxxxx",
  "organizationType": "Enterprise Edition",
  "instanceName": "NA139",
  "parentProductionUsername": "text",
  "isJitRegistration": true,
  "isDevHub": true,
  "isDefault": true,
  "metadata": {}
}

Register a Salesforce sandbox using production org credentials

post

Registers a Salesforce sandbox organization using credentials from an already registered production org.

      Requirements:
      - The production org must be registered first using /auth/salesforce/register
      - The sandbox must be created by the same user whose credentials are stored for the production org
      - The system will validate the sandbox and retrieve all necessary details automatically
      
      This endpoint is specifically for sandboxes where you don't have the sfdxAuthUrl.
      Just-in-time authentication will be used when accessing the sandbox.
Authorizations
Body
sandboxNamestringRequired

Name of the sandbox to register

Example: dev1
productionUsernamestringRequired

Username of the production org (must be already registered)

Example: [email protected]
Responses
201

Sandbox successfully registered

application/json
post
POST /sfp/api/auth/salesforce/register-sandbox-by-name HTTP/1.1
Host: 
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 65

{
  "sandboxName": "dev1",
  "productionUsername": "[email protected]"
}
{
  "username": "text",
  "instanceUrl": "text",
  "orgId": "00D1a000000xxxxx",
  "organizationType": "Enterprise Edition",
  "instanceName": "NA139",
  "parentProductionUsername": "text",
  "isJitRegistration": true,
  "isDevHub": true,
  "isDefault": true,
  "metadata": {}
}

List registered Salesforce orgs

get

Returns a list of all registered Salesforce organizations with optional filtering.

  Filter options:
  - type: Filter by organization type (e.g., "Production", "Sandbox")
  - devhub: Filter to show only DevHub organizations
  - metadata: Filter by metadata key-value pairs using either format:
    - Comma-separated: key1=value1,key2=value2
    - JSON object: {"key1":"value1","key2":"value2"}
  
  Response includes DevHub status, default flag, and metadata for each org.
Authorizations
Query parameters
typestringOptional

Filter organizations by type (e.g., "Developer Edition", "Production", "Sandbox")

devhubbooleanOptional

Filter to show only DevHub organizations

metadatastringOptional

Filter by metadata key-value pairs. Format: key1=value1,key2=value2 or JSON object

includeAuthUrlbooleanOptional

Include sfdxAuthUrl in response (only for owner role or application tokens)

Responses
200

List of registered organizations

application/json
get
GET /sfp/api/auth/salesforce/orgs HTTP/1.1
Host: 
Authorization: Bearer JWT
Accept: */*
200

List of registered organizations

[
  {
    "username": "text",
    "instanceUrl": "text",
    "orgId": "00D1a000000xxxxx",
    "organizationType": "Enterprise Edition",
    "instanceName": "NA139",
    "parentProductionUsername": "text",
    "isJitRegistration": true,
    "isDevHub": true,
    "isDefault": true,
    "metadata": {},
    "createdAt": "2025-08-14T14:43:22.125Z"
  }
]

Get details of a specific Salesforce org

get

Returns detailed information about a specific registered Salesforce organization. Owner role and application tokens receive additional authentication details.

Authorizations
Query parameters
usernamestringRequired

Username of the Salesforce org to retrieve, or sandbox name for sandboxes with no sfdxAuthUrl

Responses
200

Organization details

application/json
get
GET /sfp/api/auth/salesforce/org?username=text HTTP/1.1
Host: 
Authorization: Bearer JWT
Accept: */*
{
  "username": "text",
  "instanceUrl": "text",
  "orgId": "00D1a000000xxxxx",
  "organizationType": "Enterprise Edition",
  "instanceName": "NA139",
  "parentProductionUsername": "text",
  "isJitRegistration": true,
  "isDevHub": true,
  "isDefault": true,
  "metadata": {},
  "createdAt": "2025-08-14T14:43:22.125Z"
}

Delete a Salesforce org registration

delete

Removes the stored credentials for a Salesforce organization

Authorizations
Query parameters
usernamestringRequired

Username of the Salesforce org to delete, or sandbox name for sandboxes with no sfdxAuthUrl

Responses
200

Organization successfully deleted

delete
DELETE /sfp/api/auth/salesforce/org?username=text HTTP/1.1
Host: 
Authorization: Bearer JWT
Accept: */*

No content

Update a Salesforce org registration

patch

Updates metadata fields of an existing Salesforce organization registration without re-validating the connection.

  Updatable fields:
  - isDevHub: Mark/unmark as DevHub
  - isDefault: Mark/unmark as default DevHub (enforces single default constraint)
  - metadata: Update metadata key-value pairs
  
  Note: This endpoint does not validate the Salesforce connection, it only updates metadata attributes.
Authorizations
Query parameters
usernamestringRequired

Username of the Salesforce org to update

Body
isDevHubbooleanOptional

Whether this org is a DevHub

isDefaultbooleanOptional

Whether this is the default DevHub (only one org can have this set to true)

metadataobjectOptional

Additional metadata stored as key-value pairs

Example: {"environment":"production","region":"us-west"}
Responses
200

Organization successfully updated

application/json
patch
PATCH /sfp/api/auth/salesforce/org?username=text HTTP/1.1
Host: 
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 93

{
  "isDevHub": true,
  "isDefault": true,
  "metadata": {
    "environment": "production",
    "region": "us-west"
  }
}
{
  "username": "text",
  "instanceUrl": "text",
  "orgId": "00D1a000000xxxxx",
  "organizationType": "Enterprise Edition",
  "instanceName": "NA139",
  "parentProductionUsername": "text",
  "isJitRegistration": true,
  "isDevHub": true,
  "isDefault": true,
  "metadata": {}
}

Test connection to a Salesforce org

post

Tests if the stored credentials for a given org are still valid

Authorizations
Query parameters
usernamestringRequired

Username of the Salesforce org to test, or sandbox name for sandboxes with no sfdxAuthUrl

Responses
200

Connection test results

application/json
post
POST /sfp/api/auth/salesforce/test-connection?username=text HTTP/1.1
Host: 
Authorization: Bearer JWT
Accept: */*
{
  "isValid": true,
  "username": "text",
  "orgId": "text",
  "organizationType": "text",
  "instanceName": "text",
  "error": "text"
}

Get the default DevHub organization

get

Returns the org marked as the default DevHub with authentication details for owner role and application tokens.

Authorizations
Responses
200

Default DevHub organization details

application/json
get
GET /sfp/api/auth/salesforce/default-devhub HTTP/1.1
Host: 
Authorization: Bearer JWT
Accept: */*
{
  "username": "text",
  "instanceUrl": "text",
  "orgId": "00D1a000000xxxxx",
  "organizationType": "Enterprise Edition",
  "instanceName": "NA139",
  "parentProductionUsername": "text",
  "isJitRegistration": true,
  "isDevHub": true,
  "isDefault": true,
  "metadata": {},
  "createdAt": "2025-08-14T14:43:22.125Z"
}

Get Salesforce org frontdoor URL

get

Returns or redirects to a frontdoor URL for a sandbox or scratch org.

    The endpoint will check in order:
    1. Registered orgs with stored auth URLs
    2. Pool instances (if repository is provided)
    3. Dynamic generation using production org credentials
    
    For pool instances, the repository parameter is required to ensure the correct sandbox is accessed.
Authorizations
Query parameters
targetstringRequired

Scratch org username, sandbox name, or pool instance name

repositorystringOptional

Repository identifier (org/repo) to search for pool instances

prodOrgstringOptional

Production org username (for dynamic sandbox generation)

redirectbooleanOptional

Redirect to frontdoor URL (default true)

Responses
200Success
get
GET /sfp/api/auth/salesforce/frontdoor?target=text HTTP/1.1
Host: 
Authorization: Bearer JWT
Accept: */*
200Success

No content

Was this helpful?