Get current project configuration state
Returns the current state of the project configuration, including version information and change tracking.
What is returned:
- lastConfigurationSnapshot: Information about the last saved version (id, version, createdAt, title)
- configurationChanged: Whether the project configuration has changed since the last version was saved
- configurationChangedAt: ISO 8601 timestamp when configuration last changed (null if unchanged)
- productCount: Number of products in the project
- componentCount: Number of components in the project
- manualPositionCount: Number of manual positions in the project
- discountCount: Number of discounts applied
- snapshotCount: Total number of versions saved for the project
- documentCount: Number of documents associated with the project
Use cases:
- Check if there are unsaved changes (configurationChanged flag)
- Get overview of project contents
- Determine if a new version should be created
- View version history count
GET
/projects/{id}/configuration-stateAuthorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:reador
AuthorizationBearer token (JWT) · headerrequiredPath parameters
idstringrequiredResponses
200Project configuration state
componentCountnumberrequiredNumber of components currently in the project
configurationChangedbooleanrequiredWhether the project configuration has changed since the last version was saved. True means there are unsaved changes that should be versioned before proceeding with offers or documents.
configurationChangedAtobject | nullrequiredISO 8601 timestamp when the configuration last changed. Null if configuration has not changed since the last version was saved.
discountCountnumberrequiredNumber of discounts currently applied to the project
documentCountnumberrequiredNumber of documents associated with the project
lastConfigurationSnapshotobject | nullrequiredInformation about the last saved version (snapshot). Null if no versions have been created yet. Contains the version ID, semantic version string, creation timestamp, and title.
Show propertiesHide properties
createdAtstring<date-time>ISO 8601 timestamp when version was created
idstringVersion ID (UUID)
titlestringVersion title
versionstringSemantic version string
manualPositionCountnumberrequiredNumber of manual positions currently in the project
productCountnumberrequiredNumber of products currently in the project
projectIdstringrequiredProject UUID
snapshotCountnumberrequiredTotal number of versions (snapshots) saved for the project
401Unauthorized - Invalid or missing authentication token
403Forbidden - Insufficient API scopes or permissions
404Project not found
Request
curl -X GET "https://leadtime.app/api/public/projects/string/configuration-state" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"const response = await fetch("https://leadtime.app/api/public/projects/string/configuration-state", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
}
});import requests
response = requests.get(
"https://leadtime.app/api/public/projects/string/configuration-state",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
},
)Response
{
"componentCount": 10,
"configurationChanged": false,
"configurationChangedAt": null,
"discountCount": 1,
"documentCount": 0,
"lastConfigurationSnapshot": {
"createdAt": "2024-01-15T10:30:00.000Z",
"id": "660e8400-e29b-41d4-a716-446655440001",
"title": "Version 1.2.3",
"version": "1.2.3"
},
"manualPositionCount": 2,
"productCount": 5,
"projectId": "550e8400-e29b-41d4-a716-446655440000",
"snapshotCount": 3
}Unauthorized - Invalid or missing authentication token
Forbidden - Insufficient API scopes or permissions
Project not found