POST

Validate Slug


Checks whether a custom slug is validate for the service.

The checks include:

  • The slug adheres to the supported format.
  • No other service is currently using the slug.
  • No other service has used the slug in the past.

The call fails if at least one of the checks fails.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Bookings - all permissions
Manage Bookings
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/_api/bookings/v2/services/slugs/validate

Body Params
serviceIdstringRequiredformat GUID

IO of the service to check custom slug validity for.


slugstringmaxLength 500

Custom slug to validate.

Response Object
validboolean

Whether the slug is valid.


slugstringmaxLength 500

Valid slug. Available only if {"valid": true}.


errorsArray <string>maxItems 3

Reasons why the slug is invalid. Available only if {"valid": false}.

Validate a custom slug
Request
cURL
curl -X POST 'https://www.wixapis.com/bookings/v2/services/slugs/validate' \ -H 'Authorization: <AUTH>' \ -d '{ "serviceId": "d779a301-398d-4552-aa8c-3bef0b65cedb", "slug_name": "custom_slug" }'
Response
JSON
{ "valid": true, "slug_name": "custom_slug", "errors": [] }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?