Skip to content

Validate a SVAML payload

Request

This endpoint checks the structure and content of the SVAML commands to ensure they conform to the expected schema and rules. It can operate in different validation modes, such as strict or lenient, depending on the requirements.

Security
BasicAuth or SinchOAuth2
Path
projectIdstring, (uuid)(Project ID)required

The ID of the project.

Bodyapplication/json
svamlobject(SVAML Input)required

The SVAML payload to validate.

validationTypestring

Controls how strictly the SVAML payload is validated.

Default:"NORMAL"
Enum ValueDescription
NORMAL

Applies the same validation rules used when initiating a call. Unknown or extra properties are ignored.

STRICT

Applies stricter validation rules. Returns errors for any properties that are not recognised or not expected in the given context.

curl -i -X POST \
  -u '<username>:<password>' \
  'https://voice.api.sinch.com/v2/projects/{projectId}/svaml/validate' \
  -H 'Content-Type: application/json' \
  -d '{
    "validationType": "STRICT",
    "svaml": {
      "callName": "incoming",
      "commands": [
        {
          "command": "answer"
        },
        {
          "command": "messages",
          "messages": [
            {
              "type": "SAY",
              "say": {
                "text": "Welcome to ACME support.",
                "voiceName": "Emma"
              }
            }
          ]
        }
      ]
    }
  }'

Responses

Validation performed

Bodyapplication/json
isValidbooleanrequired

true if the submitted SVAML payload passed validation; false if one or more errors were found.

errorsArray of strings

Validation error messages describing why the SVAML payload is invalid.

Present only when isValid is false. Each entry identifies a specific problem, including the affected field or command where applicable.

Response
{ "isValid": true }
We'd love to hear from you!
Rate this content: