Orgs

sfp server API reference for Orgs: 13 endpoints.

POST/sfp/api/auth/salesforce/register
      Registers a new Salesforce organization or updates an existing one.            Requirements:      - sfdxAuthUrl is required (Generate using: sf org:display -u your@org.com --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.

Authorization

access-token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/sfp/api/auth/salesforce/register" \  -H "Content-Type: application/json" \  -d '{}'
{  "username": "string",  "instanceUrl": "string",  "orgId": "00D1a000000xxxxx",  "organizationType": "Enterprise Edition",  "instanceName": "NA139",  "parentProductionUsername": "string",  "isJitRegistration": true,  "isDevHub": true,  "isDefault": true,  "metadata": {},  "authType": "refresh_token"}
POST/sfp/api/auth/salesforce/register-sandbox-by-name
      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.

Authorization

access-token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/sfp/api/auth/salesforce/register-sandbox-by-name" \  -H "Content-Type: application/json" \  -d '{    "sandboxName": "dev1",    "productionUsername": "admin@mycompany.com"  }'
{  "username": "string",  "instanceUrl": "string",  "orgId": "00D1a000000xxxxx",  "organizationType": "Enterprise Edition",  "instanceName": "NA139",  "parentProductionUsername": "string",  "isJitRegistration": true,  "isDevHub": true,  "isDefault": true,  "metadata": {},  "authType": "refresh_token"}
GET/sfp/api/auth/salesforce/orgs

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.

Authorization

access-token
AuthorizationBearer <token>

In: header

Query Parameters

type?string

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

devhub?boolean

Filter to show only DevHub organizations

metadata?string

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

Response Body

application/json

curl -X GET "https://example.com/sfp/api/auth/salesforce/orgs"
[  {    "username": "string",    "instanceUrl": "string",    "orgId": "00D1a000000xxxxx",    "organizationType": "Enterprise Edition",    "instanceName": "NA139",    "parentProductionUsername": "string",    "isJitRegistration": true,    "isDevHub": true,    "isDefault": true,    "metadata": {},    "authType": "refresh_token",    "createdAt": "2019-08-24T14:15:22Z"  }]
GET/sfp/api/auth/salesforce/org

Returns detailed information about a specific registered Salesforce organization. Owner role and application tokens can request authentication credentials.

Authorization

access-token
AuthorizationBearer <token>

In: header

Query Parameters

username*string

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

authType?string

Type of authentication to return: "accessToken" (short-lived, default), "sfdxAuthUrl" (long-lived refresh token for long-running operations), or "jwt" (the External Client App JWT credential for orgs registered with JWT bearer auth)

Value in

  • "accessToken"
  • "sfdxAuthUrl"
  • "jwt"

Response Body

application/json

curl -X GET "https://example.com/sfp/api/auth/salesforce/org?username=string"
{  "username": "string",  "instanceUrl": "string",  "orgId": "00D1a000000xxxxx",  "organizationType": "Enterprise Edition",  "instanceName": "NA139",  "parentProductionUsername": "string",  "isJitRegistration": true,  "isDevHub": true,  "isDefault": true,  "metadata": {},  "authType": "refresh_token",  "createdAt": "2019-08-24T14:15:22Z"}
PATCH/sfp/api/auth/salesforce/org

Updates fields of an existing Salesforce organization registration.

  Updatable fields:  - isDevHub: Mark/unmark as DevHub. Marking an org as a DevHub verifies it really is one (a Dev-Hub-only ScratchOrgInfo probe) and rejects naming the actual org type if not.  - isDefault: Mark/unmark as default DevHub (enforces single default constraint)  - metadata: Update metadata key-value pairs  - sfdxAuthUrl: Replace the stored credentials. The new URL is validated and the resolved username must match the target org. On success, derived fields (instanceUrl, orgId, instanceName, organizationType) are refreshed from the validation result.  Note: Setting isDevHub=true always verifies the org is a DevHub, even without a new sfdxAuthUrl. isDefault and metadata updates skip connection validation. sfdxAuthUrl updates always validate.

Authorization

access-token
AuthorizationBearer <token>

In: header

Query Parameters

username*string

Username of the Salesforce org to update

Request Body

application/json

Metadata fields to update

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X PATCH "https://example.com/sfp/api/auth/salesforce/org?username=string" \  -H "Content-Type: application/json" \  -d '{}'
{  "username": "string",  "instanceUrl": "string",  "orgId": "00D1a000000xxxxx",  "organizationType": "Enterprise Edition",  "instanceName": "NA139",  "parentProductionUsername": "string",  "isJitRegistration": true,  "isDevHub": true,  "isDefault": true,  "metadata": {},  "authType": "refresh_token"}
DELETE/sfp/api/auth/salesforce/org

Removes the stored credentials for a Salesforce organization

Authorization

access-token
AuthorizationBearer <token>

In: header

Query Parameters

username*string

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

Response Body

curl -X DELETE "https://example.com/sfp/api/auth/salesforce/org?username=string"
Empty
POST/sfp/api/auth/salesforce/test-connection

Tests if the stored credentials for a registered org are still valid.

    **Note**: This endpoint only works for orgs that are registered in the system.    It validates that the stored sfdxAuthUrl can still be used to authenticate.

Authorization

access-token
AuthorizationBearer <token>

In: header

Query Parameters

username*string

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

Response Body

application/json

curl -X POST "https://example.com/sfp/api/auth/salesforce/test-connection?username=string"
{  "isValid": true,  "username": "string",  "orgId": "string",  "organizationType": "string",  "instanceName": "string",  "error": "string"}
GET/sfp/api/auth/salesforce/default-devhub

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

Authorization

access-token
AuthorizationBearer <token>

In: header

Query Parameters

authType?string

Type of authentication to return: "accessToken" (short-lived, default), "sfdxAuthUrl" (long-lived refresh token), or "jwt" (External Client App JWT credential)

Value in

  • "accessToken"
  • "sfdxAuthUrl"
  • "jwt"
repository?string

Registered project identifier; omitted for the legacy tenant default

Response Body

application/json

curl -X GET "https://example.com/sfp/api/auth/salesforce/default-devhub"
{  "username": "string",  "instanceUrl": "string",  "orgId": "00D1a000000xxxxx",  "organizationType": "Enterprise Edition",  "instanceName": "NA139",  "parentProductionUsername": "string",  "isJitRegistration": true,  "isDevHub": true,  "isDefault": true,  "metadata": {},  "authType": "refresh_token",  "createdAt": "2019-08-24T14:15:22Z"}
POST/sfp/api/auth/salesforce/access-token

Mints a fresh, short-lived access token so callers never handle the long-lived refresh token. Provide exactly one of:

    - `username` — a registered org, or an unregistered **scratch** pool org (resolved via the pool instance's stored auth).    - `sandboxName` — an unregistered **pool sandbox**; the parent production org is auto-resolved and the token is minted just-in-time through its connected app.    Designed for CI/CD: the token is short-lived (typically 1-2 hours) and usable directly with the CLI:    sfp org login --access-token <token> --instance-url <url>    Security: the refresh token stays on the server, tokens expire quickly, and each request mints a fresh one.

Authorization

access-token
AuthorizationBearer <token>

In: header

Query Parameters

username?string

Username of a registered or scratch-pool Salesforce org. Provide this OR sandboxName.

sandboxName?string

Name of a pool sandbox (parent production org auto-resolved). Provide this OR username.

repository?string

Legacy parameter; ignored for sandbox authentication.

Response Body

application/json

curl -X POST "https://example.com/sfp/api/auth/salesforce/access-token"
{  "accessToken": "00D1a000000xxxxx!ARcAQ...",  "instanceUrl": "https://mycompany.my.salesforce.com",  "username": "string",  "orgId": "00D1a000000xxxxx",  "isDevHub": true}
POST/sfp/api/auth/salesforce/default-devhub/access-token

Generates a new access token for the default DevHub organization.

    This is a convenience endpoint for CI/CD workflows that need DevHub access.    Use the returned access token with:    sfp org login --access-token <token> --instance-url <url> --set-default-dev-hub

Authorization

access-token
AuthorizationBearer <token>

In: header

Query Parameters

repository?string

Registered project identifier; omitted for the legacy tenant default

Response Body

application/json

curl -X POST "https://example.com/sfp/api/auth/salesforce/default-devhub/access-token"
{  "accessToken": "00D1a000000xxxxx!ARcAQ...",  "instanceUrl": "https://mycompany.my.salesforce.com",  "username": "string",  "orgId": "00D1a000000xxxxx",  "isDevHub": true}
GET/sfp/api/auth/salesforce/frontdoor

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

    Managed sandboxes use their recorded production parent unless an explicit production connection is provided.    Ambiguous sandbox names require a production connection. Repository context does not select production credentials.    Registered orgs, scratch pool instances, and unmanaged discovery retain their existing authentication paths.

Authorization

access-token
AuthorizationBearer <token>

In: header

Query Parameters

target*string

Scratch org username, sandbox name, or pool instance name

repository?string

Legacy navigation context; ignored for sandbox authentication

prodOrg?string

Production org username or alias for sandbox authentication

redirect?boolean

Redirect to frontdoor URL (default true)

Response Body

curl -X GET "https://example.com/sfp/api/auth/salesforce/frontdoor?target=string"
Empty
POST/sfp/api/auth/salesforce/sandbox/authenticate
        Generates a short-lived access token for a Salesforce sandbox that is NOT registered in the system.        **Important**: This endpoint is for sandboxes that are not registered as orgs.        For registered orgs (including registered sandboxes), use:        - `POST /auth/salesforce/access-token?username=<sandbox-username>` to generate access tokens        How it works:        1. Uses the registered production org's credentials to perform OAuth exchange        2. Calls the Salesforce /sandboxAuth API to get an auth code        3. Exchanges the auth code for an access token        4. Returns the access token (short-lived, typically 1-2 hours)        Requirements:        - The production org must be registered using /auth/salesforce/register first        - The sandbox must be created from the production org

Authorization

access-token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/sfp/api/auth/salesforce/sandbox/authenticate" \  -H "Content-Type: application/json" \  -d '{    "sandboxName": "dev1"  }'
{  "sandboxName": "dev1",  "sandboxUsername": "admin@dev1.example.com",  "accessToken": "00D...",  "instanceUrl": "https://dev1.sandbox.salesforce.com",  "frontDoorUrl": "https://dev1.sandbox.salesforce.com/secur/frontdoor.jsp?sid=00D...",  "productionOrg": {    "username": "admin@example.com",    "orgId": "00D...",    "instanceUrl": "https://example.my.salesforce.com"  }}
POST/sfp/api/auth/salesforce/scratch/authenticate
        Generates a short-lived access token for a Salesforce scratch org that is NOT registered in the system.        **Important**: This endpoint is for scratch orgs that are not registered as orgs.        For registered orgs (including registered scratch orgs), use:        - `POST /auth/salesforce/access-token?username=<scratch-org-username>` to generate access tokens        How it works:        1. Queries the DevHub's ScratchOrgInfo object for the scratch org        2. Retrieves the SfdxAuthUrl__c custom field (must be populated)        3. Uses the stored refresh token to generate a fresh access token        4. Returns the access token (short-lived, typically 1-2 hours)        Requirements:        - A DevHub org must be registered using /auth/salesforce/register first        - The scratch org must have SfdxAuthUrl__c populated in its ScratchOrgInfo record        - Managed scratch orgs use their recorded owning DevHub; untracked orgs retain automatic discovery

Authorization

access-token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/sfp/api/auth/salesforce/scratch/authenticate" \  -H "Content-Type: application/json" \  -d '{    "scratchOrgUsername": "test-xyz@example.com.scratch"  }'
{  "scratchOrgUsername": "test-xyz@example.com.scratch",  "accessToken": "00D...",  "instanceUrl": "https://power-business-1234-dev-ed.scratch.my.salesforce.com",  "frontDoorUrl": "https://power-business-1234-dev-ed.scratch.my.salesforce.com/secur/frontdoor.jsp?sid=00D...",  "sfdxAuthUrl": "force://...",  "orgId": "00D...",  "devhubOrg": {    "username": "admin@devhub.com",    "orgId": "00D...",    "instanceUrl": "https://devhub.my.salesforce.com"  }}