resetOrganizationData
Requires the permissions settings:organization:update and settings:system:update.
Deletes all of the organization's transactional and seeded data for good, in one step: all of it goes or none. The organization, users, roles, currencies, taxes, units of measure, warehouses, email configuration and appearance are kept. Needs both settings:organization:update and settings:system:update. The reset is audited.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation ResetOrganizationData($confirmationName: String!) {
resetOrganizationData(confirmationName: $confirmationName) {
details
message
success
totalDeleted
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation ResetOrganizationData($confirmationName: String!) {\n resetOrganizationData(confirmationName: $confirmationName) {\n details\n message\n success\n totalDeleted\n }\n}",
"variables": {
"confirmationName": "string"
}
}
EOF
Variables:
{
"confirmationName": "string"
}
Response:
{
"data": {
"resetOrganizationData": {
"details": {},
"message": "string",
"success": true,
"totalDeleted": 0
}
}
}
resetOrganizationData(
confirmationName: String!
): ResetDataResult!
Arguments
resetOrganizationData.confirmationName ● String! non-null scalar
The organization's exact name, typed to confirm. Not case sensitive; a mismatch is refused.
Type
ResetDataResult object
The result of resetting an organization's data.