Latest
VirtualBytesTools
Tools/Guides/API explorer

API explorer

Find the VCF 9 API call you need across SDDC Manager, the VCF Installer, vCenter, NSX and the other VCF products, see how each product signs in, and copy a ready example request.

VCF 9Runs in your browser

When to use it

  • You are scripting a VCF task and need the endpoint, the method and the sign-in for the product that owns it.
  • You know the operation in the UI, such as commissioning hosts or rotating a password, and want the API sequence behind it.
  • A script that worked on an earlier VCF fails on VCF 9, and you want to check whether the endpoint changed, as the upgrade prechecks did.

How it works

The page is one long reference with a section list on the left and a search box, Search APIs, endpoints, categories, above it. Its sections are:

  • Getting started — the pattern SDDC Manager and the VCF Installer share: a bearer token from POST /v1/tokens, paths under /v1/, and long operations that return 202 with a task ID.
  • API command builder — 15 SDDC Manager operations. Pick one under Operation, fill in its fields, and copy the result from the cURL, PowerShell or Python tab.
  • VCF 9 API catalog — the 15 API groups as cards, each linking to its deep dive.
  • Common workflows — six call sequences with an example: authenticating, commissioning hosts, creating a workload domain, rotating credentials, upgrading a domain and a new VCF deployment through the Installer.
  • Deep dives — SDDC Manager (55 categories), the VCF Installer (12), then vCenter, vSAN, NSX, VCF Operations, VCF Automation, Orchestrator, Live Recovery, HCX, Data Services Manager, Identity Broker, Private AI and the Business Services console.
  • Error handling — the SDDC Manager error body, HTTP status codes and common error codes such as RESOURCE_LOCK_NOT_AVAILABLE.

Expand a category and click an endpoint row. The tool builds the details for that call: Authentication (how that product signs in), Example request (a curl command with the product's host and header), Typical response for SDDC Manager calls, and Notes with a link to the product's API reference. Each product signs in its own way:

ProductSign-in callSent on later calls
SDDC Manager, VCF InstallerPOST /v1/tokensAuthorization: Bearer
vCenterPOST /api/session with basic authvmware-api-session-id
NSXBasic auth on every call, or POST /api/session/createBasic auth, or the JSESSIONID cookie and X-XSRF-TOKEN
VCF OperationsPOST /suite-api/api/auth/token/acquireAuthorization: OpsToken
Operations for LogsPOST /api/v2/sessions on port 9543Authorization: Bearer
HCXPOST /hybridity/api/sessionsx-hm-authorization
Live Site Recovery, vSphere ReplicationPOST /api/rest/srm/v2/session or /api/rest/vr/v2/sessionx-dr-session

Step by step

  1. Find the callType part of a path or a word into the search box, for example credentials or check-sets. The count under it shows how many endpoints match and in how many sections.
  2. Read how the product signs inOpen the endpoint row and read Authentication first. The sign-in calls themselves show the credentials they send instead of a token.
  3. Copy the example requestClick Copy next to Example request and replace the placeholders in braces, such as {sddc-manager-fqdn} or {session-id}. Where a call takes a body, the example sends -d @spec.json; the Notes link to the reference that defines it.
  4. Or build the commandFor the 15 common SDDC Manager operations, use the API command builder: the fields fill the command in every tab.
  5. Follow the async patternMost SDDC Manager changes return 202 with a task ID. Validate the spec through the matching /validations call first, then poll GET /v1/tasks/{id} until the task finishes.
  6. Check errors against the referenceIf a call fails, compare the errorCode with Error handling and read the remediationMessage in the response.

Worked example

Upgrade checks for a workload domain

In the API command builder, choose Run upgrade check-sets. Enter vcf.lab as SDDC Manager FQDN, T0K as Access Token and dom-1 as Domain ID, then open the Python tab. The script starts:

api = "https://vcf.lab/v1/system/check-sets"
headers = {"Authorization": "Bearer T0K"}

# 1. Which checks apply to the domain
query = requests.post(api + "/queries", headers=headers, verify=False,
                      json={"checkSetType": "UPGRADE", "domains": [{"domainId": "dom-1"}]})

It then posts the query's ID and each resource with its check-sets to /v1/system/check-sets and prints the run ID. No {domainId} placeholder is left.

The cURL tab does the same in three commands. The first is POST https://vcf.lab/v1/system/check-sets/queries; the second builds run.json from the answer with jq; the third polls /v1/system/check-sets/{run-id}, where you paste the ID the second call returned.

Searching for check-sets finds “4 endpoints across 1 section”, and the Upgrade a Workload Domain workflow uses the same two calls before POST /v1/upgrades.

What it doesn't do

  • Send requests. It builds text for you to run. Nothing you type in the builder leaves the browser.
  • List every endpoint. Categories show representative endpoints. The full list and the request and response schemas are in each product's reference, linked from every endpoint.
  • Show other products' responses. Only SDDC Manager calls, and the token calls, have a typical response. For the rest, the notes point to the reference.
  • Build commands outside SDDC Manager. All 15 builder operations are SDDC Manager calls.
  • Give vSAN examples. The vSAN Management API is a SOAP API. Its rows are marked CALL and have no curl example; use PowerCLI Get-VsanView or the vSAN Management SDKs.
  • Know your version. It covers VCF 9 and doesn't check which calls your build supports.

Common mistakes

  • Calling /v1/system/prechecks. VCF 9 removed it. Use the check-sets calls, as in the example above.
  • Trusting a check-set run's status alone. A run that ends COMPLETED_WITH_SUCCESS can still report critical findings. Read the results.
  • Sending a bearer token to every product. vCenter, NSX, VCF Operations, HCX and Live Recovery each expect something else. Check Authentication for the endpoint.
  • Rotating credentials in parallel. Password rotations must run one at a time (KB 434699), and the credentials calls need the ADMIN role.
  • Asking VCF Operations for JSON without saying so. Its default answer is XML. Send Accept: application/json.
  • Treating 202 as done. It means the task started. Poll it until it succeeds or fails.

Questions

How long does an SDDC Manager token last?

The access token from POST /v1/tokens is valid for an hour. When a call returns 401, send the refresh token ID to PATCH /v1/tokens/access-token/refresh for a new one.

Why do the examples use curl -k?

-k skips certificate verification, so the example works against an appliance your machine doesn't trust yet. The Python and PowerShell builders do the same. Remove it once your machine trusts the appliance's certificate.

Does the VCF Installer need a token too?

Yes. Sign in with POST /v1/tokens as the appliance's admin@local account and send the bearer token on every other Installer call.

Sources