POST
/
api
/
text_to_speech
curl --request POST \
  --url https://api.creatify.ai/api/text_to_speech/ \
  --header 'Content-Type: application/json' \
  --header 'X-API-ID: <api-key>' \
  --header 'X-API-KEY: <api-key>' \
  --data '{
  "script": "<string>",
  "accent": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "webhook_url": "<string>"
}'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "script": "<string>",
  "accent": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "webhook_url": "<string>",
  "output": "<string>",
  "media_job": "<string>",
  "is_hidden": true,
  "status": "<string>",
  "failed_reason": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

About Request Data Structure of Webhook

When using ‘text_to_speech’ API, if the ‘webhook_url’ is passed in the parameters, we will initiate a POST request to the webhook_url when the task succeeds or fails, with the following content:

{
    'id': 'string',
    'status': 'string',
    'failed_reason': 'string',
    'video_output': 'string',
}

Arguments:

  • id (string): The unique identifier of the job
  • status (string): The status of the job. Possible values are pending, in_queue, running, failed, done
  • failed_reason (string): The reason of the failure if the job failed
  • video_output (string): The URL of the video if the job is done

Note: We might send multiple requests for status changes.

Authorizations

X-API-ID
string
header
required

API ID, from your settings page.

X-API-KEY
string
header
required

API Key, from your settings page.

Body

script
string
required

Text to be converted to speech

Maximum length: 4000
accent
string | null

Accent to be used for the speech

webhook_url
string | null

Webhook URL for status updates. Default is null.

Maximum length: 200

Response

201 - application/json
id
string
required
script
string
required

Text to be converted to speech

Maximum length: 4000
output
string
required

Output audio url

media_job
string | null
required
is_hidden
boolean
required

Whether the job is hidden or not

status
string
required
failed_reason
string
required

Failed reason

created_at
string
required
updated_at
string
required
accent
string | null

Accent to be used for the speech

webhook_url
string | null

Webhook URL for status updates. Default is null.

Maximum length: 200