PUT /api/me/callback-url

Setup callback url. When speak api is finished, it will be called by POST method. The content type will be application/json.

Request

Headers

Parameters

  • None

Body as JSON Object

key

description

callback_url

an url to receive the POST /api/speak response.

Example with cURL
  curl --request PUT \
      --url https://typecast.ai/api/me/callback-url \
      --header "Content-Type: application/json" \
      --header "Authorization: Bearer $API_TOKEN" \
      --data '{
        "callback_url": "https://your.host.com/if-you-want-to-get-callback"
      }'

Response

Status Code

status code

value

401

Authorization Error

400

JSON Object that represents error. how error looks.

200

JSON Object that has result.

result consists of followings

key

description

callback_url

an url that you requested.

Example
{
  "result": {
      "callback_url": "https://your.host.com/if-you-want-to-get-callback"
  }
}

error_codes in 400 response

error_code

description

app/param/not-enough/callback_url

when callback_url is not in request body.

app/invalid/callback_url

callback_url is invalid url format.

Example
{
    "message": {
        "msg": "need callback_url argument",
        "error_code": "app/param/not-enough/callback_url"
    }
}