1.2.0
API Overview
The Sites API provides endpoints for retrieving and searching sites within Salesforce Commerce Cloud using the following capabilities:
- Site Retrieval: List all sites in an organization or retrieve a specific site by ID.
- Advanced Discovery: Use the
displayName,description, oridattributes to find specific sites for reporting or administrative operations. - Status Monitoring: Filter sites by their
inDeletionstatus to track maintenance workflows or identify sites marked for removal. - Results Management: Navigate large datasets efficiently using pagination (limit/offset), field selection, and multi-field sorting.
Sites represent individual storefronts or channels within a Commerce Cloud organization.
Authentication
For resource access, you must use a client ID and client secret from Account Manager to request an access token. The access token is used as a bearer token and added to the Authorization header of your API request.
You must include sfcc.sites (read-only access) or sfcc.sites.rw (read-write access) and other relevant scopes in the client ID used to generate the token. For a full list of permissions, see the Authorization Scopes Catalog.
For detailed setup instructions, see the Authorization for Admin APIs guide.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /organizations/{organizationId}/sites |
Returns a paginated list of sites |
| GET | /organizations/{organizationId}/sites/{siteId} |
Returns a single site by ID |
| POST | /organizations/{organizationId}/site-search |
Searches for sites using complex queries |
Attribute Reference
The following attributes can be used in search queries and sorting:
id: The unique identifier of the site (String)displayName: The user-friendly display name of the site (String)description: The description of the site (String)inDeletion: Boolean flag indicating if the site is marked for deletion (Boolean)
Use Cases
- Site Management: Find and filter sites for administrative operations.
- Site Lookup: Retrieve a specific site by ID to inspect its configuration.
- Reporting: Generate reports on site configurations and status.
- Monitoring: Track sites that are marked for deletion or maintenance.
- Lifecycle Tracking: Monitor the deletion queue by filtering for sites where
inDeletionis true.
Best Practices
- Use the
selectparameter to limit response fields and reduce payload size. - Use specific search queries to minimize result set size.
- Apply sorting to organize results meaningfully.
- Use pagination for large result sets.
- Filter out deleted sites when appropriate using the
inDeletionattribute. - Cache site information when possible to reduce API calls.
Let us know so we can improve!