Skip to content

Webhook REST APIs

List all endpoints

1
GET https://api.prosa.ai/v2/speech/webhooks/endpoints

Example responses

200 Response

1
2
3
4
5
6
7
8
[
  {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "url": "https://example.domain.name/prosa-webhook",
    "event_filters": [],
    "ssl_verification": true
  }
]

Responses

Status Meaning Description Schema
200 OK Successful Response Inline
401 Unauthorized Unauthorized UnauthorizedError
403 Forbidden Forbidden ForbiddenError

Create a new webhook endpoint

1
POST https://api.prosa.ai/v2/speech/webhooks/endpoints

Body parameter

1
2
3
4
{
  "url": "https://example.domain.name/prosa-webhook",
  "ssl_verification": true
}

Parameters

Name In Type Required Description
body body WebhookEndpointCreateDTO true -

Example responses

200 Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "url": "https://example.domain.name/prosa-webhook",
  "secrets": [
    {
      "id": "063c6473-fa0c-79b7-8000-760e63e5b4f7",
      "key": "a35837907f71e9eaf52848b54ca11135187e9e30e23f2ac001eabbc3321e9bdd"
    }
  ],
  "event_filters": [],
  "ssl_verification": true
}

Responses

Status Meaning Description Schema
200 OK Successful Response WebhookEndpointDTO
401 Unauthorized Unauthorized UnauthorizedError
403 Forbidden Forbidden ForbiddenError
422 Unprocessable Entity Validation Error RequestValidationError

Get the detail of an endpoint

1
GET https://api.prosa.ai/v2/speech/webhooks/endpoints/{endpoint_id}

Parameters

Name In Type Required Description
endpoint_id path string(uuid) true -

Example responses

200 Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "url": "https://example.domain.name/prosa-webhook",
  "secrets": [
    {
      "id": "063c6473-fa0c-79b7-8000-760e63e5b4f7",
      "key": "a35837907f71e9eaf52848b54ca11135187e9e30e23f2ac001eabbc3321e9bdd"
    }
  ],
  "event_filters": [],
  "ssl_verification": true
}

Responses

Status Meaning Description Schema
200 OK Successful Response WebhookEndpointDTO
401 Unauthorized Unauthorized UnauthorizedError
403 Forbidden Forbidden ForbiddenError
404 Not Found Not Found WebhookEndpointNotFoundError
422 Unprocessable Entity Validation Error RequestValidationError

Update a webhook endpoint

1
PUT https://api.prosa.ai/v2/speech/webhooks/endpoints/{endpoint_id}

Body parameter

1
2
3
4
{
  "url": "https://example.domain.name/prosa-webhook",
  "ssl_verification": false
}

Parameters

Name In Type Required Description
endpoint_id path string(uuid) true -
body body WebhookEndpointUpdateDTO true -

Example responses

200 Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "url": "https://example.domain.name/prosa-webhook",
  "secrets": [
    {
      "id": "063c6473-fa0c-79b7-8000-760e63e5b4f7",
      "key": "a35837907f71e9eaf52848b54ca11135187e9e30e23f2ac001eabbc3321e9bdd"
    }
  ],
  "event_filters": [],
  "ssl_verification": true
}

Responses

Status Meaning Description Schema
200 OK Successful Response WebhookEndpointDTO
401 Unauthorized Unauthorized UnauthorizedError
403 Forbidden Forbidden ForbiddenError
404 Not Found Not Found WebhookEndpointNotFoundError
422 Unprocessable Entity Validation Error RequestValidationError

Delete an endpoint

1
DELETE https://api.prosa.ai/v2/speech/webhooks/endpoints/{endpoint_id}

Parameters

Name In Type Required Description
endpoint_id path string(uuid) true -

Example responses

200 Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "url": "https://example.domain.name/prosa-webhook",
  "secrets": [
    {
      "id": "063c6473-fa0c-79b7-8000-760e63e5b4f7",
      "key": "a35837907f71e9eaf52848b54ca11135187e9e30e23f2ac001eabbc3321e9bdd"
    }
  ],
  "event_filters": [],
  "ssl_verification": true
}

Responses

Status Meaning Description Schema
200 OK Successful Response WebhookEndpointDTO
401 Unauthorized Unauthorized UnauthorizedError
403 Forbidden Forbidden ForbiddenError
404 Not Found Not Found WebhookEndpointNotFoundError
422 Unprocessable Entity Validation Error RequestValidationError

Get event delivered to an endpoint

1
GET https://api.prosa.ai/v2/speech/webhooks/endpoints/{endpoint_id}/deliveries

Parameters

Name In Type Required Description
endpoint_id path string(uuid) true -
from_date query string(date) false -
to_date query string(date) false -

Example responses

200 Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
[
  {
    "delivery_id": "9892f438-d31c-4ff2-bc84-146525b292ff",
    "event_id": "a7a26ff2-e851-45b6-9634-d595f45458b7",
    "endpoint_id": "e9ce0d4f-d433-423d-9497-4c000544106c",
    "delivery": "2023-01-17T14:26:22Z",
    "request_method": "string",
    "request_headers": {
      "host": "127.0.0.1:10010",
      "accept": "*/*",
      "connection": "keep-alive",
      "user-agent": "prosa-speech-api",
      "content-type": "application/json",
      "x-prosa-event": "stt.jobs.completed",
      "content-length": "3000",
      "accept-encoding": "gzip, deflate, br",
      "x-prosa-signature": "t=1673940396,v1=0a7600b08eb590f9f41445f30dfe76c04cf20119918b6d14c2beb16b826142eb",
      "x-prosa-event-uuid": "a7a26ff2-e851-45b6-9634-d595f45458b7"
    },
    "request_body": {
      "job_id": "063c64da-180d-731e-8000-d11a28529080",
      "created_at": "2023-01-17T14:26:25.505439",
      "modified_at": "2023-01-17T14:26:26.619771",
      "model": {
        "name": "stt-general",
        "label": "ASR General",
        "domain": "general",
        "acoustic": "recording",
        "channels": 1,
        "language": "Bahasa Indonesia",
        "samplerate": 16000
      },
      "job_config": {
        "wait": false,
        "engine": "stt-general",
        "speaker_count": 1,
        "include_filler": false,
        "include_partial_results": false
      },
      "request": {
        "uri": "https://example.domain.name/media/example_audio.wav",
        "label": "Example audio",
        "channels": 1,
        "duration": 6.766625,
        "mime_type": "audio/wav",
        "sample_rate": 8000
      },
      "result": {
        "data": [
          {
            "final": true,
            "channel": 0,
            "time_end": 6.470000009536743,
            "time_start": 1,
            "transcript": "hasil dari pekerjaan ini cukup memuaskan",
            "speaker_tag": 1
          }
        ]
      }
    },
    "response_status": 200,
    "response_headers": {
      "date": "Tue, 17 Jan 2023 14:26:23 GMT",
      "server": "uvicorn",
      "content-length": "0"
    },
    "response_body": "",
    "elapsed_time": 0.32921
  }
]

Responses

Status Meaning Description Schema
200 OK Successful Response Inline
401 Unauthorized Unauthorized UnauthorizedError
403 Forbidden Forbidden ForbiddenError
404 Not Found Not Found WebhookEndpointNotFoundError
422 Unprocessable Entity Validation Error RequestValidationError

Rotate secret keys

1
POST https://api.prosa.ai/v2/speech/webhooks/endpoints/{endpoint_id}/secret

Roll out a new secret key. Old secret keys are active within the rotation period and will be deleted at the end.

Body parameter

1
2
3
4
5
6
{
  "rotation_period": {
    "days": 3,
    "hours": 0
  }
}

Parameters

Name In Type Required Description
endpoint_id path string(uuid) true -
body body WebhookRotationDTO true -

Example responses

200 Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "url": "https://example.domain.name/prosa-webhook",
  "secrets": [
    {
      "id": "063c6473-fa0c-79b7-8000-760e63e5b4f7",
      "key": "a35837907f71e9eaf52848b54ca11135187e9e30e23f2ac001eabbc3321e9bdd"
    }
  ],
  "event_filters": [],
  "ssl_verification": true
}

Responses

Status Meaning Description Schema
200 OK Successful Response WebhookEndpointDTO
401 Unauthorized Unauthorized UnauthorizedError
403 Forbidden Forbidden ForbiddenError
404 Not Found Not Found WebhookEndpointNotFoundError
422 Unprocessable Entity Validation Error RequestValidationError

Get all events

1
GET https://api.prosa.ai/v2/speech/webhooks/events

Parameters

Name In Type Required Description
from_date query string(date) false -
to_date query string(date) false -

Example responses

200 Response

1
2
3
4
5
6
7
[
  {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "event_type": "stt.jobs.completed",
    "created_at": "2019-08-24T14:15:22Z"
  }
]

Responses

Status Meaning Description Schema
200 OK Successful Response Inline
401 Unauthorized Unauthorized UnauthorizedError
403 Forbidden Forbidden ForbiddenError
422 Unprocessable Entity Validation Error RequestValidationError

Get the detail of an event

1
GET https://api.prosa.ai/v2/speech/webhooks/events/{event_id}

Parameters

Name In Type Required Description
event_id path string(uuid) true -

Example responses

200 Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "event_type": "stt.jobs.completed",
  "data": {
    "job_id": "063c64da-180d-731e-8000-d11a28529080",
    "created_at": "2023-01-17T14:26:25.505439",
    "modified_at": "2023-01-17T14:26:26.619771",
    "model": {
      "name": "stt-general",
      "label": "ASR General",
      "domain": "general",
      "acoustic": "recording",
      "channels": 1,
      "language": "Bahasa Indonesia",
      "samplerate": 16000
    },
    "job_config": {
      "wait": false,
      "engine": "stt-general",
      "speaker_count": 1,
      "include_filler": false,
      "include_partial_results": false
    },
    "request": {
      "uri": "https://example.domain.name/media/example_audio.wav",
      "label": "Example audio",
      "channels": 1,
      "duration": 6.766625,
      "mime_type": "audio/wav",
      "sample_rate": 8000
    },
    "result": {
      "data": [
        {
          "final": true,
          "channel": 0,
          "time_end": 6.470000009536743,
          "time_start": 1,
          "transcript": "hasil dari pekerjaan ini cukup memuaskan",
          "speaker_tag": 1
        }
      ]
    }
  },
  "created_at": "2023-01-17T14:26:27.329321"
}

Responses

Status Meaning Description Schema
200 OK Successful Response WebhookEventDTO
401 Unauthorized Unauthorized UnauthorizedError
403 Forbidden Forbidden ForbiddenError
404 Not Found Not Found WebhookEventNotFoundError
422 Unprocessable Entity Validation Error RequestValidationError

Replay the delivery of an event to an endpoint

1
POST https://api.prosa.ai/v2/speech/webhooks/deliveries/{delivery_id}/replay

Parameters

Name In Type Required Description
delivery_id path string(uuid) true -

Example responses

200 Response

1
2
3
4
5
{
  "delivery_tag": "063c5237-b0ae-7d93-8000-6817f091458c",
  "endpoint_id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "url": "https://example.domain.name/prosa-webhook"
}

Responses

Status Meaning Description Schema
200 OK Successful Response DeliveryTicketDTO
401 Unauthorized Unauthorized UnauthorizedError
403 Forbidden Forbidden ForbiddenError
404 Not Found Not Found WebhookDeliveryNotFoundError
422 Unprocessable Entity Validation Error RequestValidationError

Replay failed deliveries to an endpoint

1
POST https://api.prosa.ai/v2/speech/webhooks/endpoints/{endpoint_id}/replay-failed-deliveries

Parameters

Name In Type Required Description
endpoint_id path string(uuid) true -

Example responses

200 Response

1
2
3
4
5
6
7
[
  {
    "delivery_tag": "063c5237-b0ae-7d93-8000-6817f091458c",
    "endpoint_id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "url": "https://example.domain.name/prosa-webhook"
  }
]

Responses

Status Meaning Description Schema
200 OK Successful Response Inline
401 Unauthorized Unauthorized UnauthorizedError
403 Forbidden Forbidden ForbiddenError
404 Not Found Not Found WebhookEndpointNotFoundError
422 Unprocessable Entity Validation Error RequestValidationError

Send a dummy event to a specific endpoint.

1
POST https://api.prosa.ai/v2/speech/webhooks/endpoints/{endpoint_id}/test

The event sent is of type webhook.ping. You can use this to test if your webhook endpoint has been set up correctly.

Parameters

Name In Type Required Description
endpoint_id path string(uuid) true -

Example responses

200 Response

1
2
3
4
5
{
  "delivery_tag": "063c5237-b0ae-7d93-8000-6817f091458c",
  "endpoint_id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "url": "https://example.domain.name/prosa-webhook"
}

Responses

Status Meaning Description Schema
200 OK Successful Response DeliveryTicketDTO
401 Unauthorized Unauthorized UnauthorizedError
403 Forbidden Forbidden ForbiddenError
404 Not Found Not Found WebhookEndpointNotFoundError
422 Unprocessable Entity Validation Error RequestValidationError