retell-sdk 1.15.11 → 1.15.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +747 -171
- package/dist/index.d.ts +1 -0
- package/{sdk → dist}/index.js +0 -1
- package/dist/internal/utils/contenttype.d.ts +1 -0
- package/dist/internal/utils/contenttype.js +33 -0
- package/dist/internal/utils/headers.d.ts +4 -0
- package/dist/internal/utils/headers.js +92 -0
- package/dist/internal/utils/index.d.ts +8 -0
- package/dist/internal/utils/index.js +27 -0
- package/dist/internal/utils/pathparams.d.ts +2 -0
- package/dist/internal/utils/pathparams.js +53 -0
- package/dist/internal/utils/queryparams.d.ts +2 -0
- package/dist/internal/utils/queryparams.js +182 -0
- package/dist/internal/utils/requestbody.d.ts +2 -0
- package/dist/internal/utils/requestbody.js +328 -0
- package/dist/internal/utils/retries.d.ts +20 -0
- package/dist/internal/utils/retries.js +250 -0
- package/dist/internal/utils/security.d.ts +5 -0
- package/dist/internal/utils/security.js +196 -0
- package/dist/internal/utils/utils.d.ts +37 -0
- package/dist/internal/utils/utils.js +368 -0
- package/{models → dist/models}/components/agent.d.ts +5 -35
- package/dist/models/components/agent.js +90 -0
- package/{models → dist/models}/components/agentnodefaultnorequired.d.ts +10 -36
- package/dist/models/components/agentnodefaultnorequired.js +80 -0
- package/dist/models/components/agentpromptparams.d.ts +11 -0
- package/dist/models/components/agentpromptparams.js +50 -0
- package/dist/models/components/calldetail.d.ts +58 -0
- package/dist/models/components/calldetail.js +112 -0
- package/dist/models/components/callphonenumber.d.ts +14 -0
- package/dist/models/components/callphonenumber.js +53 -0
- package/{models → dist/models}/components/index.d.ts +0 -1
- package/{models → dist/models}/components/index.js +0 -1
- package/{models → dist/models}/components/phonenumber.d.ts +2 -22
- package/dist/models/components/phonenumber.js +65 -0
- package/dist/models/components/security.d.ts +4 -0
- package/dist/models/components/security.js +45 -0
- package/dist/models/errors/createagent.d.ts +45 -0
- package/dist/models/errors/createagent.js +144 -0
- package/dist/models/errors/createphonecall.d.ts +67 -0
- package/dist/models/errors/createphonecall.js +200 -0
- package/dist/models/errors/createphonenumber.d.ts +56 -0
- package/dist/models/errors/createphonenumber.js +172 -0
- package/dist/models/errors/deleteagent.d.ts +45 -0
- package/dist/models/errors/deleteagent.js +144 -0
- package/dist/models/errors/deletephonenumber.d.ts +45 -0
- package/dist/models/errors/deletephonenumber.js +144 -0
- package/dist/models/errors/getagent.d.ts +45 -0
- package/dist/models/errors/getagent.js +144 -0
- package/dist/models/errors/getcall.d.ts +45 -0
- package/dist/models/errors/getcall.js +144 -0
- package/dist/models/errors/getphonenumber.d.ts +45 -0
- package/dist/models/errors/getphonenumber.js +144 -0
- package/{models → dist/models}/errors/index.d.ts +0 -1
- package/{models → dist/models}/errors/index.js +0 -1
- package/dist/models/errors/listagents.d.ts +23 -0
- package/dist/models/errors/listagents.js +88 -0
- package/dist/models/errors/listcalls.d.ts +34 -0
- package/dist/models/errors/listcalls.js +116 -0
- package/dist/models/errors/listphonenumbers.d.ts +34 -0
- package/dist/models/errors/listphonenumbers.js +116 -0
- package/dist/models/errors/sdkerror.d.ts +7 -0
- package/dist/models/errors/sdkerror.js +40 -0
- package/dist/models/errors/updateagent.d.ts +45 -0
- package/dist/models/errors/updateagent.js +144 -0
- package/dist/models/errors/updatephoneagent.d.ts +45 -0
- package/dist/models/errors/updatephoneagent.js +144 -0
- package/dist/models/operations/createagent.d.ts +55 -0
- package/dist/models/operations/createagent.js +128 -0
- package/dist/models/operations/createphonecall.d.ts +87 -0
- package/dist/models/operations/createphonecall.js +187 -0
- package/dist/models/operations/createphonenumber.d.ts +31 -0
- package/dist/models/operations/createphonenumber.js +98 -0
- package/dist/models/operations/deleteagent.d.ts +22 -0
- package/dist/models/operations/deleteagent.js +63 -0
- package/dist/models/operations/deletephonenumber.d.ts +22 -0
- package/dist/models/operations/deletephonenumber.js +63 -0
- package/dist/models/operations/getagent.d.ts +27 -0
- package/dist/models/operations/getagent.js +91 -0
- package/dist/models/operations/getcall.d.ts +27 -0
- package/dist/models/operations/getcall.js +91 -0
- package/dist/models/operations/getphonenumber.d.ts +27 -0
- package/dist/models/operations/getphonenumber.js +91 -0
- package/{models → dist/models}/operations/index.d.ts +0 -1
- package/{models → dist/models}/operations/index.js +0 -1
- package/dist/models/operations/listagents.d.ts +21 -0
- package/dist/models/operations/listagents.js +79 -0
- package/dist/models/operations/listcalls.d.ts +70 -0
- package/dist/models/operations/listcalls.js +145 -0
- package/dist/models/operations/listphonenumbers.d.ts +21 -0
- package/dist/models/operations/listphonenumbers.js +79 -0
- package/dist/models/operations/updateagent.d.ts +28 -0
- package/dist/models/operations/updateagent.js +95 -0
- package/dist/models/operations/updatephoneagent.d.ts +34 -0
- package/dist/models/operations/updatephoneagent.js +109 -0
- package/dist/sdk/index.d.ts +1 -0
- package/{index.js → dist/sdk/index.js} +0 -2
- package/dist/sdk/models/errors/createagent.d.ts +45 -0
- package/dist/sdk/models/errors/createagent.js +144 -0
- package/dist/sdk/models/errors/createphonecall.d.ts +67 -0
- package/dist/sdk/models/errors/createphonecall.js +200 -0
- package/dist/sdk/models/errors/createphonenumber.d.ts +56 -0
- package/dist/sdk/models/errors/createphonenumber.js +172 -0
- package/dist/sdk/models/errors/deleteagent.d.ts +45 -0
- package/dist/sdk/models/errors/deleteagent.js +144 -0
- package/dist/sdk/models/errors/deletephonenumber.d.ts +45 -0
- package/dist/sdk/models/errors/deletephonenumber.js +144 -0
- package/dist/sdk/models/errors/getagent.d.ts +45 -0
- package/dist/sdk/models/errors/getagent.js +144 -0
- package/dist/sdk/models/errors/getcall.d.ts +45 -0
- package/dist/sdk/models/errors/getcall.js +144 -0
- package/dist/sdk/models/errors/getphonenumber.d.ts +45 -0
- package/dist/sdk/models/errors/getphonenumber.js +144 -0
- package/{src/models/errors/index.ts → dist/sdk/models/errors/index.d.ts} +1 -5
- package/dist/sdk/models/errors/index.js +33 -0
- package/dist/sdk/models/errors/listagents.d.ts +23 -0
- package/dist/sdk/models/errors/listagents.js +88 -0
- package/dist/sdk/models/errors/listcalls.d.ts +34 -0
- package/dist/sdk/models/errors/listcalls.js +116 -0
- package/dist/sdk/models/errors/listphonenumbers.d.ts +34 -0
- package/dist/sdk/models/errors/listphonenumbers.js +116 -0
- package/dist/sdk/models/errors/sdkerror.d.ts +7 -0
- package/dist/sdk/models/errors/sdkerror.js +40 -0
- package/dist/sdk/models/errors/updateagent.d.ts +45 -0
- package/dist/sdk/models/errors/updateagent.js +144 -0
- package/dist/sdk/models/errors/updatephoneagent.d.ts +45 -0
- package/dist/sdk/models/errors/updatephoneagent.js +144 -0
- package/dist/sdk/models/operations/createagent.d.ts +55 -0
- package/dist/sdk/models/operations/createagent.js +128 -0
- package/dist/sdk/models/operations/createphonecall.d.ts +87 -0
- package/dist/sdk/models/operations/createphonecall.js +187 -0
- package/dist/sdk/models/operations/createphonenumber.d.ts +31 -0
- package/dist/sdk/models/operations/createphonenumber.js +98 -0
- package/dist/sdk/models/operations/deleteagent.d.ts +22 -0
- package/dist/sdk/models/operations/deleteagent.js +63 -0
- package/dist/sdk/models/operations/deletephonenumber.d.ts +22 -0
- package/dist/sdk/models/operations/deletephonenumber.js +63 -0
- package/dist/sdk/models/operations/getagent.d.ts +27 -0
- package/dist/sdk/models/operations/getagent.js +91 -0
- package/dist/sdk/models/operations/getcall.d.ts +27 -0
- package/dist/sdk/models/operations/getcall.js +91 -0
- package/dist/sdk/models/operations/getphonenumber.d.ts +27 -0
- package/dist/sdk/models/operations/getphonenumber.js +91 -0
- package/{src/models/operations/index.ts → dist/sdk/models/operations/index.d.ts} +0 -4
- package/dist/sdk/models/operations/index.js +32 -0
- package/dist/sdk/models/operations/listagents.d.ts +21 -0
- package/dist/sdk/models/operations/listagents.js +79 -0
- package/dist/sdk/models/operations/listcalls.d.ts +70 -0
- package/dist/sdk/models/operations/listcalls.js +145 -0
- package/dist/sdk/models/operations/listphonenumbers.d.ts +21 -0
- package/dist/sdk/models/operations/listphonenumbers.js +79 -0
- package/dist/sdk/models/operations/updateagent.d.ts +28 -0
- package/dist/sdk/models/operations/updateagent.js +95 -0
- package/dist/sdk/models/operations/updatephoneagent.d.ts +34 -0
- package/dist/sdk/models/operations/updatephoneagent.js +109 -0
- package/dist/sdk/models/shared/agent.d.ts +43 -0
- package/dist/sdk/models/shared/agent.js +90 -0
- package/dist/sdk/models/shared/agentnodefaultnorequired.d.ts +35 -0
- package/dist/sdk/models/shared/agentnodefaultnorequired.js +80 -0
- package/dist/sdk/models/shared/agentpromptparams.d.ts +11 -0
- package/dist/sdk/models/shared/agentpromptparams.js +50 -0
- package/dist/sdk/models/shared/calldetail.d.ts +58 -0
- package/dist/sdk/models/shared/calldetail.js +112 -0
- package/dist/sdk/models/shared/callphonenumber.d.ts +14 -0
- package/dist/sdk/models/shared/callphonenumber.js +53 -0
- package/{src/models/components/index.ts → dist/sdk/models/shared/index.d.ts} +0 -4
- package/dist/sdk/models/shared/index.js +26 -0
- package/dist/sdk/models/shared/phonenumber.d.ts +23 -0
- package/dist/sdk/models/shared/phonenumber.js +65 -0
- package/dist/sdk/models/shared/security.d.ts +4 -0
- package/dist/sdk/models/shared/security.js +45 -0
- package/dist/sdk/sdk.d.ts +99 -0
- package/dist/sdk/sdk.js +1496 -0
- package/dist/sdk/types/index.d.ts +1 -0
- package/{types/decimal.js → dist/sdk/types/index.js} +1 -2
- package/dist/sdk/types/rfcdate.d.ts +9 -0
- package/dist/sdk/types/rfcdate.js +59 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +20 -0
- package/dist/types/rfcdate.d.ts +9 -0
- package/dist/types/rfcdate.js +59 -0
- package/docs/models/components/agent.md +17 -0
- package/docs/models/components/agentnodefaultnorequired.md +15 -0
- package/docs/models/components/agentpromptparams.md +9 -0
- package/docs/models/components/calldetail.md +17 -0
- package/docs/models/components/callphonenumber.md +11 -0
- package/docs/models/components/callstatus.md +12 -0
- package/docs/models/components/calltype.md +12 -0
- package/docs/models/components/phonenumber.md +12 -0
- package/docs/models/components/security.md +8 -0
- package/docs/models/errors/createagentresponse422responsebody.md +11 -0
- package/docs/models/errors/createagentresponse500responsebody.md +11 -0
- package/docs/models/errors/createagentresponsebody.md +11 -0
- package/docs/models/errors/createagentresponseresponsebody.md +11 -0
- package/docs/models/errors/createphonecallresponse402responsebody.md +11 -0
- package/docs/models/errors/createphonecallresponse422responsebody.md +11 -0
- package/docs/models/errors/createphonecallresponse429responsebody.md +11 -0
- package/docs/models/errors/createphonecallresponse500responsebody.md +11 -0
- package/docs/models/errors/createphonecallresponsebody.md +11 -0
- package/docs/models/errors/createphonecallresponseresponsebody.md +11 -0
- package/docs/models/errors/createphonenumberresponse402responsebody.md +11 -0
- package/docs/models/errors/createphonenumberresponse422responsebody.md +11 -0
- package/docs/models/errors/createphonenumberresponse500responsebody.md +11 -0
- package/docs/models/errors/createphonenumberresponsebody.md +11 -0
- package/docs/models/errors/createphonenumberresponseresponsebody.md +11 -0
- package/docs/models/errors/deleteagentresponse422responsebody.md +11 -0
- package/docs/models/errors/deleteagentresponse500responsebody.md +11 -0
- package/docs/models/errors/deleteagentresponsebody.md +11 -0
- package/docs/models/errors/deleteagentresponseresponsebody.md +11 -0
- package/docs/models/errors/deletephonenumberresponse422responsebody.md +11 -0
- package/docs/models/errors/deletephonenumberresponse500responsebody.md +11 -0
- package/docs/models/errors/deletephonenumberresponsebody.md +11 -0
- package/docs/models/errors/deletephonenumberresponseresponsebody.md +11 -0
- package/docs/models/errors/getagentresponse422responsebody.md +11 -0
- package/docs/models/errors/getagentresponse500responsebody.md +11 -0
- package/docs/models/errors/getagentresponsebody.md +11 -0
- package/docs/models/errors/getagentresponseresponsebody.md +11 -0
- package/docs/models/errors/getcallresponse422responsebody.md +11 -0
- package/docs/models/errors/getcallresponse500responsebody.md +11 -0
- package/docs/models/errors/getcallresponsebody.md +11 -0
- package/docs/models/errors/getcallresponseresponsebody.md +11 -0
- package/docs/models/errors/getphonenumberresponse422responsebody.md +11 -0
- package/docs/models/errors/getphonenumberresponse500responsebody.md +11 -0
- package/docs/models/errors/getphonenumberresponsebody.md +11 -0
- package/docs/models/errors/getphonenumberresponseresponsebody.md +11 -0
- package/docs/models/errors/listagentsresponsebody.md +11 -0
- package/docs/models/errors/listagentsresponseresponsebody.md +11 -0
- package/docs/models/errors/listcallsresponse500responsebody.md +11 -0
- package/docs/models/errors/listcallsresponsebody.md +11 -0
- package/docs/models/errors/listcallsresponseresponsebody.md +11 -0
- package/docs/models/errors/listphonenumbersresponse500responsebody.md +11 -0
- package/docs/models/errors/listphonenumbersresponsebody.md +11 -0
- package/docs/models/errors/listphonenumbersresponseresponsebody.md +11 -0
- package/docs/models/errors/updateagentresponse422responsebody.md +11 -0
- package/docs/models/errors/updateagentresponse500responsebody.md +11 -0
- package/docs/models/errors/updateagentresponsebody.md +11 -0
- package/docs/models/errors/updateagentresponseresponsebody.md +11 -0
- package/docs/models/errors/updatephoneagentresponse422responsebody.md +11 -0
- package/docs/models/errors/updatephoneagentresponse500responsebody.md +11 -0
- package/docs/models/errors/updatephoneagentresponsebody.md +11 -0
- package/docs/models/errors/updatephoneagentresponseresponsebody.md +11 -0
- package/docs/models/operations/callstatus.md +12 -0
- package/docs/models/operations/calltype.md +10 -0
- package/docs/models/operations/createagentrequestbody.md +15 -0
- package/docs/models/operations/createagentresponse.md +11 -0
- package/docs/models/operations/createphonecallcalltype.md +12 -0
- package/docs/models/operations/createphonecallrequestbody.md +9 -0
- package/docs/models/operations/createphonecallresponse.md +11 -0
- package/docs/models/operations/createphonecallresponsebody.md +16 -0
- package/docs/models/operations/createphonenumberrequestbody.md +9 -0
- package/docs/models/operations/createphonenumberresponse.md +11 -0
- package/docs/models/operations/deleteagentrequest.md +8 -0
- package/docs/models/operations/deleteagentresponse.md +10 -0
- package/docs/models/operations/deletephonenumberrequest.md +8 -0
- package/docs/models/operations/deletephonenumberresponse.md +10 -0
- package/docs/models/operations/filtercriteria.md +13 -0
- package/docs/models/operations/getagentrequest.md +8 -0
- package/docs/models/operations/getagentresponse.md +11 -0
- package/docs/models/operations/getcallrequest.md +8 -0
- package/docs/models/operations/getcallresponse.md +11 -0
- package/docs/models/operations/getphonenumberrequest.md +8 -0
- package/docs/models/operations/getphonenumberresponse.md +11 -0
- package/docs/models/operations/listagentsresponse.md +11 -0
- package/docs/models/operations/listcallsrequest.md +10 -0
- package/docs/models/operations/listcallsresponse.md +11 -0
- package/docs/models/operations/listphonenumbersresponse.md +11 -0
- package/docs/models/operations/phonenumber.md +11 -0
- package/docs/models/operations/sortorder.md +11 -0
- package/docs/models/operations/updateagentrequest.md +9 -0
- package/docs/models/operations/updateagentresponse.md +11 -0
- package/docs/models/operations/updatephoneagentrequest.md +9 -0
- package/docs/models/operations/updatephoneagentrequestbody.md +8 -0
- package/docs/models/operations/updatephoneagentresponse.md +11 -0
- package/docs/sdks/retellclient/README.md +150 -190
- package/package.json +26 -25
- package/index.d.ts +0 -3
- package/index.d.ts.map +0 -1
- package/index.js.map +0 -1
- package/lib/base64.d.ts +0 -10
- package/lib/base64.d.ts.map +0 -1
- package/lib/base64.js +0 -61
- package/lib/base64.js.map +0 -1
- package/lib/config.d.ts +0 -31
- package/lib/config.d.ts.map +0 -1
- package/lib/config.js +0 -36
- package/lib/config.js.map +0 -1
- package/lib/encodings.d.ts +0 -41
- package/lib/encodings.d.ts.map +0 -1
- package/lib/encodings.js +0 -308
- package/lib/encodings.js.map +0 -1
- package/lib/http.d.ts +0 -45
- package/lib/http.d.ts.map +0 -1
- package/lib/http.js +0 -135
- package/lib/http.js.map +0 -1
- package/lib/retries.d.ts +0 -18
- package/lib/retries.d.ts.map +0 -1
- package/lib/retries.js +0 -136
- package/lib/retries.js.map +0 -1
- package/lib/sdks.d.ts +0 -32
- package/lib/sdks.d.ts.map +0 -1
- package/lib/sdks.js +0 -90
- package/lib/sdks.js.map +0 -1
- package/lib/security.d.ts +0 -57
- package/lib/security.d.ts.map +0 -1
- package/lib/security.js +0 -99
- package/lib/security.js.map +0 -1
- package/lib/url.d.ts +0 -4
- package/lib/url.d.ts.map +0 -1
- package/lib/url.js +0 -26
- package/lib/url.js.map +0 -1
- package/models/components/agent.d.ts.map +0 -1
- package/models/components/agent.js +0 -66
- package/models/components/agent.js.map +0 -1
- package/models/components/agentnodefaultnorequired.d.ts.map +0 -1
- package/models/components/agentnodefaultnorequired.js +0 -66
- package/models/components/agentnodefaultnorequired.js.map +0 -1
- package/models/components/agentpromptparams.d.ts +0 -25
- package/models/components/agentpromptparams.d.ts.map +0 -1
- package/models/components/agentpromptparams.js +0 -34
- package/models/components/agentpromptparams.js.map +0 -1
- package/models/components/calldetail.d.ts +0 -92
- package/models/components/calldetail.d.ts.map +0 -1
- package/models/components/calldetail.js +0 -94
- package/models/components/calldetail.js.map +0 -1
- package/models/components/callphonenumber.d.ts +0 -28
- package/models/components/callphonenumber.d.ts.map +0 -1
- package/models/components/callphonenumber.js +0 -34
- package/models/components/callphonenumber.js.map +0 -1
- package/models/components/index.d.ts.map +0 -1
- package/models/components/index.js.map +0 -1
- package/models/components/phonenumber.d.ts.map +0 -1
- package/models/components/phonenumber.js +0 -46
- package/models/components/phonenumber.js.map +0 -1
- package/models/components/security.d.ts +0 -4
- package/models/components/security.d.ts.map +0 -1
- package/models/components/security.js +0 -6
- package/models/components/security.js.map +0 -1
- package/models/errors/createagent.d.ts +0 -146
- package/models/errors/createagent.d.ts.map +0 -1
- package/models/errors/createagent.js +0 -236
- package/models/errors/createagent.js.map +0 -1
- package/models/errors/createphonecall.d.ts +0 -218
- package/models/errors/createphonecall.d.ts.map +0 -1
- package/models/errors/createphonecall.js +0 -350
- package/models/errors/createphonecall.js.map +0 -1
- package/models/errors/createphonenumber.d.ts +0 -182
- package/models/errors/createphonenumber.d.ts.map +0 -1
- package/models/errors/createphonenumber.js +0 -295
- package/models/errors/createphonenumber.js.map +0 -1
- package/models/errors/deleteagent.d.ts +0 -146
- package/models/errors/deleteagent.d.ts.map +0 -1
- package/models/errors/deleteagent.js +0 -236
- package/models/errors/deleteagent.js.map +0 -1
- package/models/errors/deletephonenumber.d.ts +0 -146
- package/models/errors/deletephonenumber.d.ts.map +0 -1
- package/models/errors/deletephonenumber.js +0 -238
- package/models/errors/deletephonenumber.js.map +0 -1
- package/models/errors/getagent.d.ts +0 -146
- package/models/errors/getagent.d.ts.map +0 -1
- package/models/errors/getagent.js +0 -236
- package/models/errors/getagent.js.map +0 -1
- package/models/errors/getcall.d.ts +0 -146
- package/models/errors/getcall.d.ts.map +0 -1
- package/models/errors/getcall.js +0 -240
- package/models/errors/getcall.js.map +0 -1
- package/models/errors/getphonenumber.d.ts +0 -146
- package/models/errors/getphonenumber.d.ts.map +0 -1
- package/models/errors/getphonenumber.js +0 -236
- package/models/errors/getphonenumber.js.map +0 -1
- package/models/errors/index.d.ts.map +0 -1
- package/models/errors/index.js.map +0 -1
- package/models/errors/listagents.d.ts +0 -74
- package/models/errors/listagents.d.ts.map +0 -1
- package/models/errors/listagents.js +0 -124
- package/models/errors/listagents.js.map +0 -1
- package/models/errors/listcalls.d.ts +0 -110
- package/models/errors/listcalls.d.ts.map +0 -1
- package/models/errors/listcalls.js +0 -181
- package/models/errors/listcalls.js.map +0 -1
- package/models/errors/listphonenumbers.d.ts +0 -110
- package/models/errors/listphonenumbers.d.ts.map +0 -1
- package/models/errors/listphonenumbers.js +0 -179
- package/models/errors/listphonenumbers.js.map +0 -1
- package/models/errors/sdkerror.d.ts +0 -7
- package/models/errors/sdkerror.d.ts.map +0 -1
- package/models/errors/sdkerror.js +0 -22
- package/models/errors/sdkerror.js.map +0 -1
- package/models/errors/updateagent.d.ts +0 -146
- package/models/errors/updateagent.d.ts.map +0 -1
- package/models/errors/updateagent.js +0 -236
- package/models/errors/updateagent.js.map +0 -1
- package/models/errors/updatephoneagent.d.ts +0 -146
- package/models/errors/updatephoneagent.d.ts.map +0 -1
- package/models/errors/updatephoneagent.js +0 -236
- package/models/errors/updatephoneagent.js.map +0 -1
- package/models/operations/createagent.d.ts +0 -97
- package/models/operations/createagent.d.ts.map +0 -1
- package/models/operations/createagent.js +0 -126
- package/models/operations/createagent.js.map +0 -1
- package/models/operations/createphonecall.d.ts +0 -157
- package/models/operations/createphonecall.d.ts.map +0 -1
- package/models/operations/createphonecall.js +0 -196
- package/models/operations/createphonecall.js.map +0 -1
- package/models/operations/createphonenumber.d.ts +0 -61
- package/models/operations/createphonenumber.d.ts.map +0 -1
- package/models/operations/createphonenumber.js +0 -94
- package/models/operations/createphonenumber.js.map +0 -1
- package/models/operations/deleteagent.d.ts +0 -48
- package/models/operations/deleteagent.d.ts.map +0 -1
- package/models/operations/deleteagent.js +0 -62
- package/models/operations/deleteagent.js.map +0 -1
- package/models/operations/deletephonenumber.d.ts +0 -48
- package/models/operations/deletephonenumber.d.ts.map +0 -1
- package/models/operations/deletephonenumber.js +0 -62
- package/models/operations/deletephonenumber.js.map +0 -1
- package/models/operations/getagent.d.ts +0 -55
- package/models/operations/getagent.d.ts.map +0 -1
- package/models/operations/getagent.js +0 -90
- package/models/operations/getagent.js.map +0 -1
- package/models/operations/getcall.d.ts +0 -55
- package/models/operations/getcall.d.ts.map +0 -1
- package/models/operations/getcall.js +0 -90
- package/models/operations/getcall.js.map +0 -1
- package/models/operations/getphonenumber.d.ts +0 -55
- package/models/operations/getphonenumber.d.ts.map +0 -1
- package/models/operations/getphonenumber.js +0 -90
- package/models/operations/getphonenumber.js.map +0 -1
- package/models/operations/index.d.ts.map +0 -1
- package/models/operations/index.js.map +0 -1
- package/models/operations/listagents.d.ts +0 -38
- package/models/operations/listagents.d.ts.map +0 -1
- package/models/operations/listagents.js +0 -68
- package/models/operations/listagents.js.map +0 -1
- package/models/operations/listcalls.d.ts +0 -127
- package/models/operations/listcalls.d.ts.map +0 -1
- package/models/operations/listcalls.js +0 -174
- package/models/operations/listcalls.js.map +0 -1
- package/models/operations/listphonenumbers.d.ts +0 -38
- package/models/operations/listphonenumbers.d.ts.map +0 -1
- package/models/operations/listphonenumbers.js +0 -68
- package/models/operations/listphonenumbers.js.map +0 -1
- package/models/operations/updateagent.d.ts +0 -58
- package/models/operations/updateagent.d.ts.map +0 -1
- package/models/operations/updateagent.js +0 -94
- package/models/operations/updateagent.js.map +0 -1
- package/models/operations/updatephoneagent.d.ts +0 -75
- package/models/operations/updatephoneagent.d.ts.map +0 -1
- package/models/operations/updatephoneagent.js +0 -116
- package/models/operations/updatephoneagent.js.map +0 -1
- package/sdk/index.d.ts +0 -2
- package/sdk/index.d.ts.map +0 -1
- package/sdk/index.js.map +0 -1
- package/sdk/sdk.d.ts +0 -61
- package/sdk/sdk.d.ts.map +0 -1
- package/sdk/sdk.js +0 -1131
- package/sdk/sdk.js.map +0 -1
- package/src/index.ts +0 -6
- package/src/lib/base64.ts +0 -37
- package/src/lib/config.ts +0 -57
- package/src/lib/encodings.ts +0 -379
- package/src/lib/http.ts +0 -201
- package/src/lib/retries.ts +0 -207
- package/src/lib/sdks.ts +0 -107
- package/src/lib/security.ts +0 -164
- package/src/lib/url.ts +0 -31
- package/src/models/components/agent.ts +0 -133
- package/src/models/components/agentnodefaultnorequired.ts +0 -121
- package/src/models/components/agentpromptparams.ts +0 -53
- package/src/models/components/calldetail.ts +0 -160
- package/src/models/components/callphonenumber.ts +0 -56
- package/src/models/components/phonenumber.ts +0 -83
- package/src/models/components/security.ts +0 -7
- package/src/models/errors/createagent.ts +0 -394
- package/src/models/errors/createphonecall.ts +0 -597
- package/src/models/errors/createphonenumber.ts +0 -500
- package/src/models/errors/deleteagent.ts +0 -394
- package/src/models/errors/deletephonenumber.ts +0 -400
- package/src/models/errors/getagent.ts +0 -383
- package/src/models/errors/getcall.ts +0 -379
- package/src/models/errors/getphonenumber.ts +0 -397
- package/src/models/errors/listagents.ts +0 -192
- package/src/models/errors/listcalls.ts +0 -289
- package/src/models/errors/listphonenumbers.ts +0 -297
- package/src/models/errors/sdkerror.ts +0 -24
- package/src/models/errors/updateagent.ts +0 -394
- package/src/models/errors/updatephoneagent.ts +0 -397
- package/src/models/operations/createagent.ts +0 -192
- package/src/models/operations/createphonecall.ts +0 -302
- package/src/models/operations/createphonenumber.ts +0 -124
- package/src/models/operations/deleteagent.ts +0 -103
- package/src/models/operations/deletephonenumber.ts +0 -103
- package/src/models/operations/getagent.ts +0 -114
- package/src/models/operations/getcall.ts +0 -114
- package/src/models/operations/getphonenumber.ts +0 -114
- package/src/models/operations/listagents.ts +0 -76
- package/src/models/operations/listcalls.ts +0 -255
- package/src/models/operations/listphonenumbers.ts +0 -76
- package/src/models/operations/updateagent.ts +0 -121
- package/src/models/operations/updatephoneagent.ts +0 -159
- package/src/sdk/index.ts +0 -5
- package/src/sdk/sdk.ts +0 -1179
- package/src/types/blobs.ts +0 -30
- package/src/types/decimal.ts +0 -5
- package/src/types/index.ts +0 -8
- package/src/types/operations.ts +0 -6
- package/src/types/rfcdate.ts +0 -54
- package/types/blobs.d.ts +0 -4
- package/types/blobs.d.ts.map +0 -1
- package/types/blobs.js +0 -52
- package/types/blobs.js.map +0 -1
- package/types/decimal.d.ts +0 -2
- package/types/decimal.d.ts.map +0 -1
- package/types/decimal.js.map +0 -1
- package/types/index.d.ts +0 -5
- package/types/index.d.ts.map +0 -1
- package/types/index.js +0 -14
- package/types/index.js.map +0 -1
- package/types/operations.d.ts +0 -5
- package/types/operations.d.ts.map +0 -1
- package/types/operations.js +0 -6
- package/types/operations.js.map +0 -1
- package/types/rfcdate.d.ts +0 -21
- package/types/rfcdate.d.ts.map +0 -1
- package/types/rfcdate.js +0 -46
- package/types/rfcdate.js.map +0 -1
package/README.md
CHANGED
|
@@ -2,20 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
<div align="left">
|
|
4
4
|
<a href="https://speakeasyapi.dev/"><img src="https://custom-icon-badges.demolab.com/badge/-Built%20By%20Speakeasy-212015?style=for-the-badge&logoColor=FBE331&logo=speakeasy&labelColor=545454" /></a>
|
|
5
|
-
<a href="https://opensource.org/licenses/MIT">
|
|
6
|
-
<img src="https://img.shields.io/badge/License-MIT-blue.svg" style="width: 100px; height: 28px;" />
|
|
7
|
-
</a>
|
|
8
5
|
</div>
|
|
9
6
|
|
|
10
|
-
|
|
11
|
-
## 🏗 **Welcome to your new SDK!** 🏗
|
|
12
|
-
|
|
13
|
-
It has been generated successfully based on your OpenAPI spec. However, it is not yet ready for production use. Here are some next steps:
|
|
14
|
-
- [ ] 🛠 Make your SDK feel handcrafted by [customizing it](https://www.speakeasyapi.dev/docs/customize-sdks)
|
|
15
|
-
- [ ] ♻️ Refine your SDK quickly by iterating locally with the [Speakeasy CLI](https://github.com/speakeasy-api/speakeasy)
|
|
16
|
-
- [ ] 🎁 Publish your SDK to package managers by [configuring automatic publishing](https://www.speakeasyapi.dev/docs/productionize-sdks/publish-sdks)
|
|
17
|
-
- [ ] ✨ When ready to productionize, delete this section from the README
|
|
18
|
-
|
|
19
7
|
<!-- Start SDK Installation [installation] -->
|
|
20
8
|
## SDK Installation
|
|
21
9
|
|
|
@@ -44,7 +32,7 @@ import { RetellClient } from "retell-sdk";
|
|
|
44
32
|
|
|
45
33
|
async function run() {
|
|
46
34
|
const sdk = new RetellClient({
|
|
47
|
-
apiKey: "
|
|
35
|
+
apiKey: "",
|
|
48
36
|
});
|
|
49
37
|
|
|
50
38
|
const res = await sdk.createAgent({
|
|
@@ -58,11 +46,9 @@ async function run() {
|
|
|
58
46
|
voiceId: "elevenlabs-xxcrwXReTKMHWjqi7Q27",
|
|
59
47
|
});
|
|
60
48
|
|
|
61
|
-
if (res
|
|
62
|
-
|
|
49
|
+
if (res.statusCode == 200) {
|
|
50
|
+
// handle response
|
|
63
51
|
}
|
|
64
|
-
|
|
65
|
-
// handle response
|
|
66
52
|
}
|
|
67
53
|
|
|
68
54
|
run();
|
|
@@ -78,7 +64,7 @@ import { RetellClient } from "retell-sdk";
|
|
|
78
64
|
|
|
79
65
|
async function run() {
|
|
80
66
|
const sdk = new RetellClient({
|
|
81
|
-
apiKey: "
|
|
67
|
+
apiKey: "",
|
|
82
68
|
});
|
|
83
69
|
|
|
84
70
|
const res = await sdk.createPhoneCall({
|
|
@@ -94,11 +80,9 @@ async function run() {
|
|
|
94
80
|
},
|
|
95
81
|
});
|
|
96
82
|
|
|
97
|
-
if (res
|
|
98
|
-
|
|
83
|
+
if (res.statusCode == 200) {
|
|
84
|
+
// handle response
|
|
99
85
|
}
|
|
100
|
-
|
|
101
|
-
// handle response
|
|
102
86
|
}
|
|
103
87
|
|
|
104
88
|
run();
|
|
@@ -114,7 +98,7 @@ import { RetellClient } from "retell-sdk";
|
|
|
114
98
|
|
|
115
99
|
async function run() {
|
|
116
100
|
const sdk = new RetellClient({
|
|
117
|
-
apiKey: "
|
|
101
|
+
apiKey: "",
|
|
118
102
|
});
|
|
119
103
|
|
|
120
104
|
const res = await sdk.createPhoneNumber({
|
|
@@ -122,11 +106,9 @@ async function run() {
|
|
|
122
106
|
areaCode: 415,
|
|
123
107
|
});
|
|
124
108
|
|
|
125
|
-
if (res
|
|
126
|
-
|
|
109
|
+
if (res.statusCode == 200) {
|
|
110
|
+
// handle response
|
|
127
111
|
}
|
|
128
|
-
|
|
129
|
-
// handle response
|
|
130
112
|
}
|
|
131
113
|
|
|
132
114
|
run();
|
|
@@ -139,21 +121,19 @@ Delete an existing agent
|
|
|
139
121
|
|
|
140
122
|
```typescript
|
|
141
123
|
import { RetellClient } from "retell-sdk";
|
|
124
|
+
import { DeleteAgentRequest } from "retell-sdk/dist/models/operations";
|
|
142
125
|
|
|
143
126
|
async function run() {
|
|
144
127
|
const sdk = new RetellClient({
|
|
145
|
-
apiKey: "
|
|
128
|
+
apiKey: "",
|
|
146
129
|
});
|
|
147
|
-
|
|
148
|
-
const agentId = "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD";
|
|
130
|
+
const agentId: string = "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD";
|
|
149
131
|
|
|
150
132
|
const res = await sdk.deleteAgent(agentId);
|
|
151
133
|
|
|
152
|
-
if (res
|
|
153
|
-
|
|
134
|
+
if (res.statusCode == 200) {
|
|
135
|
+
// handle response
|
|
154
136
|
}
|
|
155
|
-
|
|
156
|
-
// handle response
|
|
157
137
|
}
|
|
158
138
|
|
|
159
139
|
run();
|
|
@@ -166,21 +146,19 @@ Delete a specific phone number
|
|
|
166
146
|
|
|
167
147
|
```typescript
|
|
168
148
|
import { RetellClient } from "retell-sdk";
|
|
149
|
+
import { DeletePhoneNumberRequest } from "retell-sdk/dist/models/operations";
|
|
169
150
|
|
|
170
151
|
async function run() {
|
|
171
152
|
const sdk = new RetellClient({
|
|
172
|
-
apiKey: "
|
|
153
|
+
apiKey: "",
|
|
173
154
|
});
|
|
174
|
-
|
|
175
|
-
const phoneNumber = "string";
|
|
155
|
+
const phoneNumber: string = "string";
|
|
176
156
|
|
|
177
157
|
const res = await sdk.deletePhoneNumber(phoneNumber);
|
|
178
158
|
|
|
179
|
-
if (res
|
|
180
|
-
|
|
159
|
+
if (res.statusCode == 200) {
|
|
160
|
+
// handle response
|
|
181
161
|
}
|
|
182
|
-
|
|
183
|
-
// handle response
|
|
184
162
|
}
|
|
185
163
|
|
|
186
164
|
run();
|
|
@@ -193,21 +171,19 @@ Retrieve details of a specific agent
|
|
|
193
171
|
|
|
194
172
|
```typescript
|
|
195
173
|
import { RetellClient } from "retell-sdk";
|
|
174
|
+
import { GetAgentRequest } from "retell-sdk/dist/models/operations";
|
|
196
175
|
|
|
197
176
|
async function run() {
|
|
198
177
|
const sdk = new RetellClient({
|
|
199
|
-
apiKey: "
|
|
178
|
+
apiKey: "",
|
|
200
179
|
});
|
|
201
|
-
|
|
202
|
-
const agentId = "16b980523634a6dc504898cda492e939";
|
|
180
|
+
const agentId: string = "16b980523634a6dc504898cda492e939";
|
|
203
181
|
|
|
204
182
|
const res = await sdk.getAgent(agentId);
|
|
205
183
|
|
|
206
|
-
if (res
|
|
207
|
-
|
|
184
|
+
if (res.statusCode == 200) {
|
|
185
|
+
// handle response
|
|
208
186
|
}
|
|
209
|
-
|
|
210
|
-
// handle response
|
|
211
187
|
}
|
|
212
188
|
|
|
213
189
|
run();
|
|
@@ -220,21 +196,19 @@ Retrieve details of a specific call
|
|
|
220
196
|
|
|
221
197
|
```typescript
|
|
222
198
|
import { RetellClient } from "retell-sdk";
|
|
199
|
+
import { GetCallRequest } from "retell-sdk/dist/models/operations";
|
|
223
200
|
|
|
224
201
|
async function run() {
|
|
225
202
|
const sdk = new RetellClient({
|
|
226
|
-
apiKey: "
|
|
203
|
+
apiKey: "",
|
|
227
204
|
});
|
|
228
|
-
|
|
229
|
-
const callId = "119c3f8e47135a29e65947eeb34cf12d";
|
|
205
|
+
const callId: string = "119c3f8e47135a29e65947eeb34cf12d";
|
|
230
206
|
|
|
231
207
|
const res = await sdk.getCall(callId);
|
|
232
208
|
|
|
233
|
-
if (res
|
|
234
|
-
|
|
209
|
+
if (res.statusCode == 200) {
|
|
210
|
+
// handle response
|
|
235
211
|
}
|
|
236
|
-
|
|
237
|
-
// handle response
|
|
238
212
|
}
|
|
239
213
|
|
|
240
214
|
run();
|
|
@@ -247,21 +221,19 @@ Retrieve info about a specific number
|
|
|
247
221
|
|
|
248
222
|
```typescript
|
|
249
223
|
import { RetellClient } from "retell-sdk";
|
|
224
|
+
import { GetPhoneNumberRequest } from "retell-sdk/dist/models/operations";
|
|
250
225
|
|
|
251
226
|
async function run() {
|
|
252
227
|
const sdk = new RetellClient({
|
|
253
|
-
apiKey: "
|
|
228
|
+
apiKey: "",
|
|
254
229
|
});
|
|
255
|
-
|
|
256
|
-
const phoneNumber = "+14159095857";
|
|
230
|
+
const phoneNumber: string = "+14159095857";
|
|
257
231
|
|
|
258
232
|
const res = await sdk.getPhoneNumber(phoneNumber);
|
|
259
233
|
|
|
260
|
-
if (res
|
|
261
|
-
|
|
234
|
+
if (res.statusCode == 200) {
|
|
235
|
+
// handle response
|
|
262
236
|
}
|
|
263
|
-
|
|
264
|
-
// handle response
|
|
265
237
|
}
|
|
266
238
|
|
|
267
239
|
run();
|
|
@@ -277,16 +249,14 @@ import { RetellClient } from "retell-sdk";
|
|
|
277
249
|
|
|
278
250
|
async function run() {
|
|
279
251
|
const sdk = new RetellClient({
|
|
280
|
-
apiKey: "
|
|
252
|
+
apiKey: "",
|
|
281
253
|
});
|
|
282
254
|
|
|
283
255
|
const res = await sdk.listAgents();
|
|
284
256
|
|
|
285
|
-
if (res
|
|
286
|
-
|
|
257
|
+
if (res.statusCode == 200) {
|
|
258
|
+
// handle response
|
|
287
259
|
}
|
|
288
|
-
|
|
289
|
-
// handle response
|
|
290
260
|
}
|
|
291
261
|
|
|
292
262
|
run();
|
|
@@ -299,15 +269,18 @@ Retrieve call details
|
|
|
299
269
|
|
|
300
270
|
```typescript
|
|
301
271
|
import { RetellClient } from "retell-sdk";
|
|
302
|
-
import {
|
|
303
|
-
|
|
272
|
+
import {
|
|
273
|
+
CallType,
|
|
274
|
+
FilterCriteria,
|
|
275
|
+
ListCallsRequest,
|
|
276
|
+
SortOrder,
|
|
277
|
+
} from "retell-sdk/dist/models/operations";
|
|
304
278
|
|
|
305
279
|
async function run() {
|
|
306
280
|
const sdk = new RetellClient({
|
|
307
|
-
apiKey: "
|
|
281
|
+
apiKey: "",
|
|
308
282
|
});
|
|
309
|
-
|
|
310
|
-
const filterCriteria = {
|
|
283
|
+
const filterCriteria: FilterCriteria = {
|
|
311
284
|
afterEndTimestamp: 1703302428800,
|
|
312
285
|
afterStartTimestamp: 1703302407300,
|
|
313
286
|
agentId: ["oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD"],
|
|
@@ -315,16 +288,14 @@ async function run() {
|
|
|
315
288
|
beforeStartTimestamp: 1703302407399,
|
|
316
289
|
callType: [CallType.InboundPhoneCall, CallType.OutboundPhoneCall],
|
|
317
290
|
};
|
|
318
|
-
const limit = 666195;
|
|
319
|
-
const sortOrder = SortOrder.Descending;
|
|
291
|
+
const limit: number = 666195;
|
|
292
|
+
const sortOrder: SortOrder = SortOrder.Descending;
|
|
320
293
|
|
|
321
294
|
const res = await sdk.listCalls(filterCriteria, limit, sortOrder);
|
|
322
295
|
|
|
323
|
-
if (res
|
|
324
|
-
|
|
296
|
+
if (res.statusCode == 200) {
|
|
297
|
+
// handle response
|
|
325
298
|
}
|
|
326
|
-
|
|
327
|
-
// handle response
|
|
328
299
|
}
|
|
329
300
|
|
|
330
301
|
run();
|
|
@@ -340,16 +311,14 @@ import { RetellClient } from "retell-sdk";
|
|
|
340
311
|
|
|
341
312
|
async function run() {
|
|
342
313
|
const sdk = new RetellClient({
|
|
343
|
-
apiKey: "
|
|
314
|
+
apiKey: "",
|
|
344
315
|
});
|
|
345
316
|
|
|
346
317
|
const res = await sdk.listPhoneNumbers();
|
|
347
318
|
|
|
348
|
-
if (res
|
|
349
|
-
|
|
319
|
+
if (res.statusCode == 200) {
|
|
320
|
+
// handle response
|
|
350
321
|
}
|
|
351
|
-
|
|
352
|
-
// handle response
|
|
353
322
|
}
|
|
354
323
|
|
|
355
324
|
run();
|
|
@@ -362,13 +331,14 @@ Update an existing agent
|
|
|
362
331
|
|
|
363
332
|
```typescript
|
|
364
333
|
import { RetellClient } from "retell-sdk";
|
|
334
|
+
import { AgentNoDefaultNoRequired } from "retell-sdk/dist/models/components";
|
|
335
|
+
import { UpdateAgentRequest } from "retell-sdk/dist/models/operations";
|
|
365
336
|
|
|
366
337
|
async function run() {
|
|
367
338
|
const sdk = new RetellClient({
|
|
368
|
-
apiKey: "
|
|
339
|
+
apiKey: "",
|
|
369
340
|
});
|
|
370
|
-
|
|
371
|
-
const agentNoDefaultNoRequired = {
|
|
341
|
+
const agentNoDefaultNoRequired: AgentNoDefaultNoRequired = {
|
|
372
342
|
agentName: "Jarvis",
|
|
373
343
|
beginMessage: "Hello there, how can I help you.",
|
|
374
344
|
enableBeginMessage: true,
|
|
@@ -378,15 +348,13 @@ async function run() {
|
|
|
378
348
|
prompt: "You are a marketing assistant. You help come up with creative content ideas and content like marketing emails, blog posts, tweets, ad copy and product descriptions. You respond concisely, with filler words in it.",
|
|
379
349
|
voiceId: "elevenlabs-xxcrwXReTKMHWjqi7Q27",
|
|
380
350
|
};
|
|
381
|
-
const agentId = "16b980523634a6dc504898cda492e939";
|
|
351
|
+
const agentId: string = "16b980523634a6dc504898cda492e939";
|
|
382
352
|
|
|
383
353
|
const res = await sdk.updateAgent(agentNoDefaultNoRequired, agentId);
|
|
384
354
|
|
|
385
|
-
if (res
|
|
386
|
-
|
|
355
|
+
if (res.statusCode == 200) {
|
|
356
|
+
// handle response
|
|
387
357
|
}
|
|
388
|
-
|
|
389
|
-
// handle response
|
|
390
358
|
}
|
|
391
359
|
|
|
392
360
|
run();
|
|
@@ -399,24 +367,25 @@ Update an existing phone number
|
|
|
399
367
|
|
|
400
368
|
```typescript
|
|
401
369
|
import { RetellClient } from "retell-sdk";
|
|
370
|
+
import {
|
|
371
|
+
UpdatePhoneAgentRequest,
|
|
372
|
+
UpdatePhoneAgentRequestBody,
|
|
373
|
+
} from "retell-sdk/dist/models/operations";
|
|
402
374
|
|
|
403
375
|
async function run() {
|
|
404
376
|
const sdk = new RetellClient({
|
|
405
|
-
apiKey: "
|
|
377
|
+
apiKey: "",
|
|
406
378
|
});
|
|
407
|
-
|
|
408
|
-
const requestBody = {
|
|
379
|
+
const requestBody: UpdatePhoneAgentRequestBody = {
|
|
409
380
|
agentId: "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
|
|
410
381
|
};
|
|
411
|
-
const phoneNumber = "+14159095857";
|
|
382
|
+
const phoneNumber: string = "+14159095857";
|
|
412
383
|
|
|
413
384
|
const res = await sdk.updatePhoneAgent(requestBody, phoneNumber);
|
|
414
385
|
|
|
415
|
-
if (res
|
|
416
|
-
|
|
386
|
+
if (res.statusCode == 200) {
|
|
387
|
+
// handle response
|
|
417
388
|
}
|
|
418
|
-
|
|
419
|
-
// handle response
|
|
420
389
|
}
|
|
421
390
|
|
|
422
391
|
run();
|
|
@@ -447,7 +416,7 @@ run();
|
|
|
447
416
|
<!-- Start Error Handling [errors] -->
|
|
448
417
|
## Error Handling
|
|
449
418
|
|
|
450
|
-
|
|
419
|
+
Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an error. If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Error type.
|
|
451
420
|
|
|
452
421
|
| Error Object | Status Code | Content Type |
|
|
453
422
|
| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- |
|
|
@@ -455,21 +424,21 @@ All SDK methods return a response object or throw an error. If Error objects are
|
|
|
455
424
|
| errors.CreateAgentResponseResponseBody | 401 | application/json |
|
|
456
425
|
| errors.CreateAgentResponse422ResponseBody | 422 | application/json |
|
|
457
426
|
| errors.CreateAgentResponse500ResponseBody | 500 | application/json |
|
|
458
|
-
| errors.SDKError |
|
|
427
|
+
| errors.SDKError | 400-600 | */* |
|
|
459
428
|
|
|
460
429
|
Example
|
|
461
430
|
|
|
462
431
|
```typescript
|
|
463
432
|
import { RetellClient } from "retell-sdk";
|
|
464
|
-
import * as errors from "retell-sdk/models/errors";
|
|
465
433
|
|
|
466
434
|
async function run() {
|
|
467
435
|
const sdk = new RetellClient({
|
|
468
|
-
apiKey: "
|
|
436
|
+
apiKey: "",
|
|
469
437
|
});
|
|
470
438
|
|
|
471
|
-
|
|
472
|
-
|
|
439
|
+
let res;
|
|
440
|
+
try {
|
|
441
|
+
res = await sdk.createAgent({
|
|
473
442
|
agentName: "Jarvis",
|
|
474
443
|
beginMessage: "Hello there, how can I help you?",
|
|
475
444
|
enableBeginMessage: true,
|
|
@@ -478,30 +447,29 @@ async function run() {
|
|
|
478
447
|
endMessage: "Hope you have a good day, goodbye.",
|
|
479
448
|
prompt: "You are a marketing assistant. You help come up with creative content ideas and content like marketing emails, blog posts, tweets, ad copy and product descriptions. You respond concisely, with filler words in it.",
|
|
480
449
|
voiceId: "elevenlabs-xxcrwXReTKMHWjqi7Q27",
|
|
481
|
-
})
|
|
482
|
-
.catch((err) => {
|
|
483
|
-
if (err instanceof errors.CreateAgentResponseBody) {
|
|
484
|
-
console.error(err); // handle exception
|
|
485
|
-
return null;
|
|
486
|
-
} else if (err instanceof errors.CreateAgentResponseResponseBody) {
|
|
487
|
-
console.error(err); // handle exception
|
|
488
|
-
return null;
|
|
489
|
-
} else if (err instanceof errors.CreateAgentResponse422ResponseBody) {
|
|
490
|
-
console.error(err); // handle exception
|
|
491
|
-
return null;
|
|
492
|
-
} else if (err instanceof errors.CreateAgentResponse500ResponseBody) {
|
|
493
|
-
console.error(err); // handle exception
|
|
494
|
-
return null;
|
|
495
|
-
} else {
|
|
496
|
-
throw err;
|
|
497
|
-
}
|
|
498
450
|
});
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
451
|
+
} catch (err) {
|
|
452
|
+
if (err instanceof errors.CreateAgentResponseBody) {
|
|
453
|
+
console.error(err); // handle exception
|
|
454
|
+
throw err;
|
|
455
|
+
} else if (err instanceof errors.CreateAgentResponseResponseBody) {
|
|
456
|
+
console.error(err); // handle exception
|
|
457
|
+
throw err;
|
|
458
|
+
} else if (err instanceof errors.CreateAgentResponse422ResponseBody) {
|
|
459
|
+
console.error(err); // handle exception
|
|
460
|
+
throw err;
|
|
461
|
+
} else if (err instanceof errors.CreateAgentResponse500ResponseBody) {
|
|
462
|
+
console.error(err); // handle exception
|
|
463
|
+
throw err;
|
|
464
|
+
} else if (err instanceof errors.SDKError) {
|
|
465
|
+
console.error(err); // handle exception
|
|
466
|
+
throw err;
|
|
467
|
+
}
|
|
502
468
|
}
|
|
503
469
|
|
|
504
|
-
|
|
470
|
+
if (res.statusCode == 200) {
|
|
471
|
+
// handle response
|
|
472
|
+
}
|
|
505
473
|
}
|
|
506
474
|
|
|
507
475
|
run();
|
|
@@ -520,60 +488,87 @@ You can override the default server globally by passing a server index to the `s
|
|
|
520
488
|
| - | ------ | --------- |
|
|
521
489
|
| 0 | `https://api.re-tell.ai` | None |
|
|
522
490
|
|
|
491
|
+
#### Example
|
|
523
492
|
|
|
493
|
+
```typescript
|
|
494
|
+
import { RetellClient } from "retell-sdk";
|
|
524
495
|
|
|
496
|
+
async function run() {
|
|
497
|
+
const sdk = new RetellClient({
|
|
498
|
+
serverIdx: 0,
|
|
499
|
+
apiKey: "",
|
|
500
|
+
});
|
|
525
501
|
|
|
526
|
-
|
|
502
|
+
const res = await sdk.createAgent({
|
|
503
|
+
agentName: "Jarvis",
|
|
504
|
+
beginMessage: "Hello there, how can I help you?",
|
|
505
|
+
enableBeginMessage: true,
|
|
506
|
+
enableEndCall: true,
|
|
507
|
+
enableEndMessage: false,
|
|
508
|
+
endMessage: "Hope you have a good day, goodbye.",
|
|
509
|
+
prompt: "You are a marketing assistant. You help come up with creative content ideas and content like marketing emails, blog posts, tweets, ad copy and product descriptions. You respond concisely, with filler words in it.",
|
|
510
|
+
voiceId: "elevenlabs-xxcrwXReTKMHWjqi7Q27",
|
|
511
|
+
});
|
|
527
512
|
|
|
528
|
-
|
|
529
|
-
|
|
513
|
+
if (res.statusCode == 200) {
|
|
514
|
+
// handle response
|
|
515
|
+
}
|
|
516
|
+
}
|
|
530
517
|
|
|
531
|
-
|
|
532
|
-
## Custom HTTP Client
|
|
518
|
+
run();
|
|
533
519
|
|
|
534
|
-
|
|
535
|
-
[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This
|
|
536
|
-
client is a thin wrapper around `fetch` and provides the ability to attach hooks
|
|
537
|
-
around the request lifecycle that can be used to modify the request or handle
|
|
538
|
-
errors and response.
|
|
520
|
+
```
|
|
539
521
|
|
|
540
|
-
The `HTTPClient` constructor takes an optional `fetcher` argument that can be
|
|
541
|
-
used to integrate a third-party HTTP client or when writing tests to mock out
|
|
542
|
-
the HTTP client and feed in fixtures.
|
|
543
522
|
|
|
544
|
-
|
|
545
|
-
custom header and a timeout to requests and how to use the `"requestError"` hook
|
|
546
|
-
to log errors:
|
|
523
|
+
### Override Server URL Per-Client
|
|
547
524
|
|
|
525
|
+
The default server can also be overridden globally by passing a URL to the `serverURL: str` optional parameter when initializing the SDK client instance. For example:
|
|
548
526
|
```typescript
|
|
549
527
|
import { RetellClient } from "retell-sdk";
|
|
550
|
-
import { HTTPClient } from "retell-sdk/lib/http";
|
|
551
528
|
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
529
|
+
async function run() {
|
|
530
|
+
const sdk = new RetellClient({
|
|
531
|
+
serverURL: "https://api.re-tell.ai",
|
|
532
|
+
apiKey: "",
|
|
533
|
+
});
|
|
534
|
+
|
|
535
|
+
const res = await sdk.createAgent({
|
|
536
|
+
agentName: "Jarvis",
|
|
537
|
+
beginMessage: "Hello there, how can I help you?",
|
|
538
|
+
enableBeginMessage: true,
|
|
539
|
+
enableEndCall: true,
|
|
540
|
+
enableEndMessage: false,
|
|
541
|
+
endMessage: "Hope you have a good day, goodbye.",
|
|
542
|
+
prompt: "You are a marketing assistant. You help come up with creative content ideas and content like marketing emails, blog posts, tweets, ad copy and product descriptions. You respond concisely, with filler words in it.",
|
|
543
|
+
voiceId: "elevenlabs-xxcrwXReTKMHWjqi7Q27",
|
|
544
|
+
});
|
|
545
|
+
|
|
546
|
+
if (res.statusCode == 200) {
|
|
547
|
+
// handle response
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
run();
|
|
552
|
+
|
|
553
|
+
```
|
|
554
|
+
<!-- End Server Selection [server] -->
|
|
555
|
+
|
|
556
|
+
<!-- Start Custom HTTP Client [http-client] -->
|
|
557
|
+
## Custom HTTP Client
|
|
558
558
|
|
|
559
|
-
|
|
560
|
-
const nextRequest = new Request(request, {
|
|
561
|
-
signal: request.signal || AbortSignal.timeout(5000);
|
|
562
|
-
});
|
|
559
|
+
The Typescript SDK makes API calls using the [axios](https://axios-http.com/docs/intro) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `AxiosInstance` object.
|
|
563
560
|
|
|
564
|
-
|
|
561
|
+
For example, you could specify a header for every request that your sdk makes as follows:
|
|
565
562
|
|
|
566
|
-
|
|
567
|
-
}
|
|
563
|
+
```typescript
|
|
564
|
+
import { retell-sdk } from "RetellClient";
|
|
565
|
+
import axios from "axios";
|
|
568
566
|
|
|
569
|
-
httpClient.
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
console.log("Endpoint:", `${request.method} ${request.url}`);
|
|
573
|
-
console.groupEnd();
|
|
574
|
-
});
|
|
567
|
+
const httpClient = axios.create({
|
|
568
|
+
headers: {'x-custom-header': 'someValue'}
|
|
569
|
+
})
|
|
575
570
|
|
|
576
|
-
const sdk = new RetellClient({ httpClient
|
|
571
|
+
const sdk = new RetellClient({defaultClient: httpClient});
|
|
577
572
|
```
|
|
578
573
|
<!-- End Custom HTTP Client [http-client] -->
|
|
579
574
|
|
|
@@ -584,9 +579,9 @@ const sdk = new RetellClient({ httpClient });
|
|
|
584
579
|
|
|
585
580
|
This SDK supports the following security scheme globally:
|
|
586
581
|
|
|
587
|
-
| Name
|
|
588
|
-
|
|
|
589
|
-
| `apiKey`
|
|
582
|
+
| Name | Type | Scheme |
|
|
583
|
+
| ----------- | ----------- | ----------- |
|
|
584
|
+
| `apiKey` | http | HTTP Bearer |
|
|
590
585
|
|
|
591
586
|
To authenticate with the API the `apiKey` parameter must be set when initializing the SDK client instance. For example:
|
|
592
587
|
```typescript
|
|
@@ -594,7 +589,7 @@ import { RetellClient } from "retell-sdk";
|
|
|
594
589
|
|
|
595
590
|
async function run() {
|
|
596
591
|
const sdk = new RetellClient({
|
|
597
|
-
apiKey: "
|
|
592
|
+
apiKey: "",
|
|
598
593
|
});
|
|
599
594
|
|
|
600
595
|
const res = await sdk.createAgent({
|
|
@@ -608,11 +603,9 @@ async function run() {
|
|
|
608
603
|
voiceId: "elevenlabs-xxcrwXReTKMHWjqi7Q27",
|
|
609
604
|
});
|
|
610
605
|
|
|
611
|
-
if (res
|
|
612
|
-
|
|
606
|
+
if (res.statusCode == 200) {
|
|
607
|
+
// handle response
|
|
613
608
|
}
|
|
614
|
-
|
|
615
|
-
// handle response
|
|
616
609
|
}
|
|
617
610
|
|
|
618
611
|
run();
|
|
@@ -620,6 +613,589 @@ run();
|
|
|
620
613
|
```
|
|
621
614
|
<!-- End Authentication [security] -->
|
|
622
615
|
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
<!-- Start SDK Installation -->
|
|
619
|
+
## SDK Installation
|
|
620
|
+
|
|
621
|
+
### NPM
|
|
622
|
+
|
|
623
|
+
```bash
|
|
624
|
+
npm add retell-sdk
|
|
625
|
+
```
|
|
626
|
+
|
|
627
|
+
### Yarn
|
|
628
|
+
|
|
629
|
+
```bash
|
|
630
|
+
yarn add retell-sdk
|
|
631
|
+
```
|
|
632
|
+
<!-- End SDK Installation -->
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
## SDK Example Usage
|
|
637
|
+
<!-- Start SDK Example Usage -->
|
|
638
|
+
### Create a new voice AI agent
|
|
639
|
+
|
|
640
|
+
Create a new agent
|
|
641
|
+
|
|
642
|
+
```typescript
|
|
643
|
+
import { RetellClient } from "retell-sdk";
|
|
644
|
+
|
|
645
|
+
(async () => {
|
|
646
|
+
const sdk = new RetellClient({
|
|
647
|
+
apiKey: "",
|
|
648
|
+
});
|
|
649
|
+
|
|
650
|
+
const res = await sdk.createAgent({
|
|
651
|
+
agentName: "Jarvis",
|
|
652
|
+
beginMessage: "Hello there, how can I help you?",
|
|
653
|
+
enableBeginMessage: true,
|
|
654
|
+
enableEndCall: true,
|
|
655
|
+
enableEndMessage: false,
|
|
656
|
+
endMessage: "Hope you have a good day, goodbye.",
|
|
657
|
+
prompt: "You are a marketing assistant. You help come up with creative content ideas and content like marketing emails, blog posts, tweets, ad copy and product descriptions. You respond concisely, with filler words in it.",
|
|
658
|
+
voiceId: "elevenlabs-xxcrwXReTKMHWjqi7Q27",
|
|
659
|
+
});
|
|
660
|
+
|
|
661
|
+
if (res.statusCode == 200) {
|
|
662
|
+
// handle response
|
|
663
|
+
}
|
|
664
|
+
})();
|
|
665
|
+
|
|
666
|
+
```
|
|
667
|
+
|
|
668
|
+
### Create an outbound phone call
|
|
669
|
+
|
|
670
|
+
Initiate an outbound phone call.
|
|
671
|
+
|
|
672
|
+
```typescript
|
|
673
|
+
import { RetellClient } from "retell-sdk";
|
|
674
|
+
|
|
675
|
+
(async () => {
|
|
676
|
+
const sdk = new RetellClient({
|
|
677
|
+
apiKey: "",
|
|
678
|
+
});
|
|
679
|
+
|
|
680
|
+
const res = await sdk.createPhoneCall({
|
|
681
|
+
agentPromptParams: [
|
|
682
|
+
{
|
|
683
|
+
name: "username",
|
|
684
|
+
value: "Adam",
|
|
685
|
+
},
|
|
686
|
+
],
|
|
687
|
+
phoneNumber: {
|
|
688
|
+
from: "+14159095857",
|
|
689
|
+
to: "+14159095858",
|
|
690
|
+
},
|
|
691
|
+
});
|
|
692
|
+
|
|
693
|
+
if (res.statusCode == 200) {
|
|
694
|
+
// handle response
|
|
695
|
+
}
|
|
696
|
+
})();
|
|
697
|
+
|
|
698
|
+
```
|
|
699
|
+
|
|
700
|
+
### Create a new phone number
|
|
701
|
+
|
|
702
|
+
Create a new phone number
|
|
703
|
+
|
|
704
|
+
```typescript
|
|
705
|
+
import { RetellClient } from "retell-sdk";
|
|
706
|
+
|
|
707
|
+
(async () => {
|
|
708
|
+
const sdk = new RetellClient({
|
|
709
|
+
apiKey: "",
|
|
710
|
+
});
|
|
711
|
+
|
|
712
|
+
const res = await sdk.createPhoneNumber({
|
|
713
|
+
agentId: "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
|
|
714
|
+
areaCode: 415,
|
|
715
|
+
});
|
|
716
|
+
|
|
717
|
+
if (res.statusCode == 200) {
|
|
718
|
+
// handle response
|
|
719
|
+
}
|
|
720
|
+
})();
|
|
721
|
+
|
|
722
|
+
```
|
|
723
|
+
|
|
724
|
+
### Delete an existing agent
|
|
725
|
+
|
|
726
|
+
Delete an existing agent
|
|
727
|
+
|
|
728
|
+
```typescript
|
|
729
|
+
import { RetellClient } from "retell-sdk";
|
|
730
|
+
import { DeleteAgentRequest } from "retell-sdk/dist/models/operations";
|
|
731
|
+
|
|
732
|
+
(async () => {
|
|
733
|
+
const sdk = new RetellClient({
|
|
734
|
+
apiKey: "",
|
|
735
|
+
});
|
|
736
|
+
const agentId: string = "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD";
|
|
737
|
+
|
|
738
|
+
const res = await sdk.deleteAgent(agentId);
|
|
739
|
+
|
|
740
|
+
if (res.statusCode == 200) {
|
|
741
|
+
// handle response
|
|
742
|
+
}
|
|
743
|
+
})();
|
|
744
|
+
|
|
745
|
+
```
|
|
746
|
+
|
|
747
|
+
### Delete a specific phone number
|
|
748
|
+
|
|
749
|
+
Delete a specific phone number
|
|
750
|
+
|
|
751
|
+
```typescript
|
|
752
|
+
import { RetellClient } from "retell-sdk";
|
|
753
|
+
import { DeletePhoneNumberRequest } from "retell-sdk/dist/models/operations";
|
|
754
|
+
|
|
755
|
+
(async () => {
|
|
756
|
+
const sdk = new RetellClient({
|
|
757
|
+
apiKey: "",
|
|
758
|
+
});
|
|
759
|
+
const phoneNumber: string = "string";
|
|
760
|
+
|
|
761
|
+
const res = await sdk.deletePhoneNumber(phoneNumber);
|
|
762
|
+
|
|
763
|
+
if (res.statusCode == 200) {
|
|
764
|
+
// handle response
|
|
765
|
+
}
|
|
766
|
+
})();
|
|
767
|
+
|
|
768
|
+
```
|
|
769
|
+
|
|
770
|
+
### Retrieve details of an agent
|
|
771
|
+
|
|
772
|
+
Retrieve details of a specific agent
|
|
773
|
+
|
|
774
|
+
```typescript
|
|
775
|
+
import { RetellClient } from "retell-sdk";
|
|
776
|
+
import { GetAgentRequest } from "retell-sdk/dist/models/operations";
|
|
777
|
+
|
|
778
|
+
(async () => {
|
|
779
|
+
const sdk = new RetellClient({
|
|
780
|
+
apiKey: "",
|
|
781
|
+
});
|
|
782
|
+
const agentId: string = "16b980523634a6dc504898cda492e939";
|
|
783
|
+
|
|
784
|
+
const res = await sdk.getAgent(agentId);
|
|
785
|
+
|
|
786
|
+
if (res.statusCode == 200) {
|
|
787
|
+
// handle response
|
|
788
|
+
}
|
|
789
|
+
})();
|
|
790
|
+
|
|
791
|
+
```
|
|
792
|
+
|
|
793
|
+
### Retrieve a on-going or finished call
|
|
794
|
+
|
|
795
|
+
Retrieve details of a specific call
|
|
796
|
+
|
|
797
|
+
```typescript
|
|
798
|
+
import { RetellClient } from "retell-sdk";
|
|
799
|
+
import { GetCallRequest } from "retell-sdk/dist/models/operations";
|
|
800
|
+
|
|
801
|
+
(async () => {
|
|
802
|
+
const sdk = new RetellClient({
|
|
803
|
+
apiKey: "",
|
|
804
|
+
});
|
|
805
|
+
const callId: string = "119c3f8e47135a29e65947eeb34cf12d";
|
|
806
|
+
|
|
807
|
+
const res = await sdk.getCall(callId);
|
|
808
|
+
|
|
809
|
+
if (res.statusCode == 200) {
|
|
810
|
+
// handle response
|
|
811
|
+
}
|
|
812
|
+
})();
|
|
813
|
+
|
|
814
|
+
```
|
|
815
|
+
|
|
816
|
+
### Retrieve info about a specific number
|
|
817
|
+
|
|
818
|
+
Retrieve info about a specific number
|
|
819
|
+
|
|
820
|
+
```typescript
|
|
821
|
+
import { RetellClient } from "retell-sdk";
|
|
822
|
+
import { GetPhoneNumberRequest } from "retell-sdk/dist/models/operations";
|
|
823
|
+
|
|
824
|
+
(async () => {
|
|
825
|
+
const sdk = new RetellClient({
|
|
826
|
+
apiKey: "",
|
|
827
|
+
});
|
|
828
|
+
const phoneNumber: string = "+14159095857";
|
|
829
|
+
|
|
830
|
+
const res = await sdk.getPhoneNumber(phoneNumber);
|
|
831
|
+
|
|
832
|
+
if (res.statusCode == 200) {
|
|
833
|
+
// handle response
|
|
834
|
+
}
|
|
835
|
+
})();
|
|
836
|
+
|
|
837
|
+
```
|
|
838
|
+
|
|
839
|
+
### List all agents
|
|
840
|
+
|
|
841
|
+
List all agents
|
|
842
|
+
|
|
843
|
+
```typescript
|
|
844
|
+
import { RetellClient } from "retell-sdk";
|
|
845
|
+
|
|
846
|
+
(async () => {
|
|
847
|
+
const sdk = new RetellClient({
|
|
848
|
+
apiKey: "",
|
|
849
|
+
});
|
|
850
|
+
|
|
851
|
+
const res = await sdk.listAgents();
|
|
852
|
+
|
|
853
|
+
if (res.statusCode == 200) {
|
|
854
|
+
// handle response
|
|
855
|
+
}
|
|
856
|
+
})();
|
|
857
|
+
|
|
858
|
+
```
|
|
859
|
+
|
|
860
|
+
### List all web or phone calls
|
|
861
|
+
|
|
862
|
+
Retrieve call details
|
|
863
|
+
|
|
864
|
+
```typescript
|
|
865
|
+
import { RetellClient } from "retell-sdk";
|
|
866
|
+
import {
|
|
867
|
+
CallType,
|
|
868
|
+
FilterCriteria,
|
|
869
|
+
ListCallsRequest,
|
|
870
|
+
SortOrder,
|
|
871
|
+
} from "retell-sdk/dist/models/operations";
|
|
872
|
+
|
|
873
|
+
(async () => {
|
|
874
|
+
const sdk = new RetellClient({
|
|
875
|
+
apiKey: "",
|
|
876
|
+
});
|
|
877
|
+
const filterCriteria: FilterCriteria = {
|
|
878
|
+
afterEndTimestamp: 1703302428800,
|
|
879
|
+
afterStartTimestamp: 1703302407300,
|
|
880
|
+
agentId: ["oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD"],
|
|
881
|
+
beforeEndTimestamp: 1703302428899,
|
|
882
|
+
beforeStartTimestamp: 1703302407399,
|
|
883
|
+
callType: [CallType.InboundPhoneCall, CallType.OutboundPhoneCall],
|
|
884
|
+
};
|
|
885
|
+
const limit: number = 666195;
|
|
886
|
+
const sortOrder: SortOrder = SortOrder.Descending;
|
|
887
|
+
|
|
888
|
+
const res = await sdk.listCalls(filterCriteria, limit, sortOrder);
|
|
889
|
+
|
|
890
|
+
if (res.statusCode == 200) {
|
|
891
|
+
// handle response
|
|
892
|
+
}
|
|
893
|
+
})();
|
|
894
|
+
|
|
895
|
+
```
|
|
896
|
+
|
|
897
|
+
### List all purchased and active phone numbers
|
|
898
|
+
|
|
899
|
+
List all purchased and active phone numbers
|
|
900
|
+
|
|
901
|
+
```typescript
|
|
902
|
+
import { RetellClient } from "retell-sdk";
|
|
903
|
+
|
|
904
|
+
(async () => {
|
|
905
|
+
const sdk = new RetellClient({
|
|
906
|
+
apiKey: "",
|
|
907
|
+
});
|
|
908
|
+
|
|
909
|
+
const res = await sdk.listPhoneNumbers();
|
|
910
|
+
|
|
911
|
+
if (res.statusCode == 200) {
|
|
912
|
+
// handle response
|
|
913
|
+
}
|
|
914
|
+
})();
|
|
915
|
+
|
|
916
|
+
```
|
|
917
|
+
|
|
918
|
+
### Update an existing agent
|
|
919
|
+
|
|
920
|
+
Update an existing agent
|
|
921
|
+
|
|
922
|
+
```typescript
|
|
923
|
+
import { RetellClient } from "retell-sdk";
|
|
924
|
+
import { AgentNoDefaultNoRequired } from "retell-sdk/dist/models/components";
|
|
925
|
+
import { UpdateAgentRequest } from "retell-sdk/dist/models/operations";
|
|
926
|
+
|
|
927
|
+
(async () => {
|
|
928
|
+
const sdk = new RetellClient({
|
|
929
|
+
apiKey: "",
|
|
930
|
+
});
|
|
931
|
+
const agentNoDefaultNoRequired: AgentNoDefaultNoRequired = {
|
|
932
|
+
agentName: "Jarvis",
|
|
933
|
+
beginMessage: "Hello there, how can I help you.",
|
|
934
|
+
enableBeginMessage: true,
|
|
935
|
+
enableEndCall: true,
|
|
936
|
+
enableEndMessage: false,
|
|
937
|
+
endMessage: "Hope you have a good day, goodbye.",
|
|
938
|
+
prompt: "You are a marketing assistant. You help come up with creative content ideas and content like marketing emails, blog posts, tweets, ad copy and product descriptions. You respond concisely, with filler words in it.",
|
|
939
|
+
voiceId: "elevenlabs-xxcrwXReTKMHWjqi7Q27",
|
|
940
|
+
};
|
|
941
|
+
const agentId: string = "16b980523634a6dc504898cda492e939";
|
|
942
|
+
|
|
943
|
+
const res = await sdk.updateAgent(agentNoDefaultNoRequired, agentId);
|
|
944
|
+
|
|
945
|
+
if (res.statusCode == 200) {
|
|
946
|
+
// handle response
|
|
947
|
+
}
|
|
948
|
+
})();
|
|
949
|
+
|
|
950
|
+
```
|
|
951
|
+
|
|
952
|
+
### Update an existing phone number
|
|
953
|
+
|
|
954
|
+
Update an existing phone number
|
|
955
|
+
|
|
956
|
+
```typescript
|
|
957
|
+
import { RetellClient } from "retell-sdk";
|
|
958
|
+
import {
|
|
959
|
+
UpdatePhoneAgentRequest,
|
|
960
|
+
UpdatePhoneAgentRequestBody,
|
|
961
|
+
} from "retell-sdk/dist/models/operations";
|
|
962
|
+
|
|
963
|
+
(async () => {
|
|
964
|
+
const sdk = new RetellClient({
|
|
965
|
+
apiKey: "",
|
|
966
|
+
});
|
|
967
|
+
const requestBody: UpdatePhoneAgentRequestBody = {
|
|
968
|
+
agentId: "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
|
|
969
|
+
};
|
|
970
|
+
const phoneNumber: string = "+14159095857";
|
|
971
|
+
|
|
972
|
+
const res = await sdk.updatePhoneAgent(requestBody, phoneNumber);
|
|
973
|
+
|
|
974
|
+
if (res.statusCode == 200) {
|
|
975
|
+
// handle response
|
|
976
|
+
}
|
|
977
|
+
})();
|
|
978
|
+
|
|
979
|
+
```
|
|
980
|
+
<!-- End SDK Example Usage -->
|
|
981
|
+
|
|
982
|
+
|
|
983
|
+
|
|
984
|
+
<!-- Start SDK Available Operations -->
|
|
985
|
+
## Available Resources and Operations
|
|
986
|
+
|
|
987
|
+
### [RetellClient SDK](docs/sdks/retellclient/README.md)
|
|
988
|
+
|
|
989
|
+
* [createAgent](docs/sdks/retellclient/README.md#createagent) - Create a new agent
|
|
990
|
+
* [createPhoneCall](docs/sdks/retellclient/README.md#createphonecall) - Initiate an outbound phone call.
|
|
991
|
+
* [createPhoneNumber](docs/sdks/retellclient/README.md#createphonenumber) - Create a new phone number
|
|
992
|
+
* [deleteAgent](docs/sdks/retellclient/README.md#deleteagent) - Delete an existing agent
|
|
993
|
+
* [deletePhoneNumber](docs/sdks/retellclient/README.md#deletephonenumber) - Delete a specific phone number
|
|
994
|
+
* [getAgent](docs/sdks/retellclient/README.md#getagent) - Retrieve details of a specific agent
|
|
995
|
+
* [getCall](docs/sdks/retellclient/README.md#getcall) - Retrieve details of a specific call
|
|
996
|
+
* [getPhoneNumber](docs/sdks/retellclient/README.md#getphonenumber) - Retrieve info about a specific number
|
|
997
|
+
* [listAgents](docs/sdks/retellclient/README.md#listagents) - List all agents
|
|
998
|
+
* [listCalls](docs/sdks/retellclient/README.md#listcalls) - Retrieve call details
|
|
999
|
+
* [listPhoneNumbers](docs/sdks/retellclient/README.md#listphonenumbers) - List all purchased and active phone numbers
|
|
1000
|
+
* [updateAgent](docs/sdks/retellclient/README.md#updateagent) - Update an existing agent
|
|
1001
|
+
* [updatePhoneAgent](docs/sdks/retellclient/README.md#updatephoneagent) - Update an existing phone number
|
|
1002
|
+
<!-- End SDK Available Operations -->
|
|
1003
|
+
|
|
1004
|
+
|
|
1005
|
+
|
|
1006
|
+
<!-- Start Error Handling -->
|
|
1007
|
+
## Error Handling
|
|
1008
|
+
|
|
1009
|
+
Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an error. If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Error type.
|
|
1010
|
+
|
|
1011
|
+
| Error Object | Status Code | Content Type |
|
|
1012
|
+
| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- |
|
|
1013
|
+
| errors.CreateAgentResponseBody | 400 | application/json |
|
|
1014
|
+
| errors.CreateAgentResponseResponseBody | 401 | application/json |
|
|
1015
|
+
| errors.CreateAgentResponse422ResponseBody | 422 | application/json |
|
|
1016
|
+
| errors.CreateAgentResponse500ResponseBody | 500 | application/json |
|
|
1017
|
+
| errors.SDKError | 400-600 | */* |
|
|
1018
|
+
|
|
1019
|
+
Example
|
|
1020
|
+
|
|
1021
|
+
```typescript
|
|
1022
|
+
import { RetellClient } from "retell-sdk";
|
|
1023
|
+
|
|
1024
|
+
(async () => {
|
|
1025
|
+
const sdk = new RetellClient({
|
|
1026
|
+
apiKey: "",
|
|
1027
|
+
});
|
|
1028
|
+
|
|
1029
|
+
let res;
|
|
1030
|
+
try {
|
|
1031
|
+
res = await sdk.createAgent({
|
|
1032
|
+
agentName: "Jarvis",
|
|
1033
|
+
beginMessage: "Hello there, how can I help you?",
|
|
1034
|
+
enableBeginMessage: true,
|
|
1035
|
+
enableEndCall: true,
|
|
1036
|
+
enableEndMessage: false,
|
|
1037
|
+
endMessage: "Hope you have a good day, goodbye.",
|
|
1038
|
+
prompt: "You are a marketing assistant. You help come up with creative content ideas and content like marketing emails, blog posts, tweets, ad copy and product descriptions. You respond concisely, with filler words in it.",
|
|
1039
|
+
voiceId: "elevenlabs-xxcrwXReTKMHWjqi7Q27",
|
|
1040
|
+
});
|
|
1041
|
+
} catch (e) {
|
|
1042
|
+
if (e instanceof errors.CreateAgentResponseBody) {
|
|
1043
|
+
console.error(e); // handle exception
|
|
1044
|
+
} else if (e instanceof errors.CreateAgentResponseResponseBody) {
|
|
1045
|
+
console.error(e); // handle exception
|
|
1046
|
+
} else if (e instanceof errors.CreateAgentResponse422ResponseBody) {
|
|
1047
|
+
console.error(e); // handle exception
|
|
1048
|
+
} else if (e instanceof errors.CreateAgentResponse500ResponseBody) {
|
|
1049
|
+
console.error(e); // handle exception
|
|
1050
|
+
} else if (e instanceof errors.SDKError) {
|
|
1051
|
+
console.error(e); // handle exception
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
if (res.statusCode == 200) {
|
|
1056
|
+
// handle response
|
|
1057
|
+
}
|
|
1058
|
+
})();
|
|
1059
|
+
|
|
1060
|
+
```
|
|
1061
|
+
<!-- End Error Handling -->
|
|
1062
|
+
|
|
1063
|
+
|
|
1064
|
+
|
|
1065
|
+
<!-- Start Server Selection -->
|
|
1066
|
+
## Server Selection
|
|
1067
|
+
|
|
1068
|
+
### Select Server by Index
|
|
1069
|
+
|
|
1070
|
+
You can override the default server globally by passing a server index to the `serverIdx: number` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:
|
|
1071
|
+
|
|
1072
|
+
| # | Server | Variables |
|
|
1073
|
+
| - | ------ | --------- |
|
|
1074
|
+
| 0 | `https://api.re-tell.ai` | None |
|
|
1075
|
+
|
|
1076
|
+
#### Example
|
|
1077
|
+
|
|
1078
|
+
```typescript
|
|
1079
|
+
import { RetellClient } from "retell-sdk";
|
|
1080
|
+
|
|
1081
|
+
(async () => {
|
|
1082
|
+
const sdk = new RetellClient({
|
|
1083
|
+
serverIdx: 0,
|
|
1084
|
+
apiKey: "",
|
|
1085
|
+
});
|
|
1086
|
+
|
|
1087
|
+
const res = await sdk.createAgent({
|
|
1088
|
+
agentName: "Jarvis",
|
|
1089
|
+
beginMessage: "Hello there, how can I help you?",
|
|
1090
|
+
enableBeginMessage: true,
|
|
1091
|
+
enableEndCall: true,
|
|
1092
|
+
enableEndMessage: false,
|
|
1093
|
+
endMessage: "Hope you have a good day, goodbye.",
|
|
1094
|
+
prompt: "You are a marketing assistant. You help come up with creative content ideas and content like marketing emails, blog posts, tweets, ad copy and product descriptions. You respond concisely, with filler words in it.",
|
|
1095
|
+
voiceId: "elevenlabs-xxcrwXReTKMHWjqi7Q27",
|
|
1096
|
+
});
|
|
1097
|
+
|
|
1098
|
+
if (res.statusCode == 200) {
|
|
1099
|
+
// handle response
|
|
1100
|
+
}
|
|
1101
|
+
})();
|
|
1102
|
+
|
|
1103
|
+
```
|
|
1104
|
+
|
|
1105
|
+
|
|
1106
|
+
### Override Server URL Per-Client
|
|
1107
|
+
|
|
1108
|
+
The default server can also be overridden globally by passing a URL to the `serverURL: str` optional parameter when initializing the SDK client instance. For example:
|
|
1109
|
+
```typescript
|
|
1110
|
+
import { RetellClient } from "retell-sdk";
|
|
1111
|
+
|
|
1112
|
+
(async () => {
|
|
1113
|
+
const sdk = new RetellClient({
|
|
1114
|
+
serverURL: "https://api.re-tell.ai",
|
|
1115
|
+
apiKey: "",
|
|
1116
|
+
});
|
|
1117
|
+
|
|
1118
|
+
const res = await sdk.createAgent({
|
|
1119
|
+
agentName: "Jarvis",
|
|
1120
|
+
beginMessage: "Hello there, how can I help you?",
|
|
1121
|
+
enableBeginMessage: true,
|
|
1122
|
+
enableEndCall: true,
|
|
1123
|
+
enableEndMessage: false,
|
|
1124
|
+
endMessage: "Hope you have a good day, goodbye.",
|
|
1125
|
+
prompt: "You are a marketing assistant. You help come up with creative content ideas and content like marketing emails, blog posts, tweets, ad copy and product descriptions. You respond concisely, with filler words in it.",
|
|
1126
|
+
voiceId: "elevenlabs-xxcrwXReTKMHWjqi7Q27",
|
|
1127
|
+
});
|
|
1128
|
+
|
|
1129
|
+
if (res.statusCode == 200) {
|
|
1130
|
+
// handle response
|
|
1131
|
+
}
|
|
1132
|
+
})();
|
|
1133
|
+
|
|
1134
|
+
```
|
|
1135
|
+
<!-- End Server Selection -->
|
|
1136
|
+
|
|
1137
|
+
|
|
1138
|
+
|
|
1139
|
+
<!-- Start Custom HTTP Client -->
|
|
1140
|
+
## Custom HTTP Client
|
|
1141
|
+
|
|
1142
|
+
The Typescript SDK makes API calls using the (axios)[https://axios-http.com/docs/intro] HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `AxiosInstance` object.
|
|
1143
|
+
|
|
1144
|
+
For example, you could specify a header for every request that your sdk makes as follows:
|
|
1145
|
+
|
|
1146
|
+
```typescript
|
|
1147
|
+
from retell-sdk import RetellClient;
|
|
1148
|
+
import axios;
|
|
1149
|
+
|
|
1150
|
+
const httpClient = axios.create({
|
|
1151
|
+
headers: {'x-custom-header': 'someValue'}
|
|
1152
|
+
})
|
|
1153
|
+
|
|
1154
|
+
const sdk = new RetellClient({defaultClient: httpClient});
|
|
1155
|
+
```
|
|
1156
|
+
<!-- End Custom HTTP Client -->
|
|
1157
|
+
|
|
1158
|
+
|
|
1159
|
+
|
|
1160
|
+
<!-- Start Authentication -->
|
|
1161
|
+
## Authentication
|
|
1162
|
+
|
|
1163
|
+
### Per-Client Security Schemes
|
|
1164
|
+
|
|
1165
|
+
This SDK supports the following security scheme globally:
|
|
1166
|
+
|
|
1167
|
+
| Name | Type | Scheme |
|
|
1168
|
+
| ----------- | ----------- | ----------- |
|
|
1169
|
+
| `apiKey` | http | HTTP Bearer |
|
|
1170
|
+
|
|
1171
|
+
To authenticate with the API the `apiKey` parameter must be set when initializing the SDK client instance. For example:
|
|
1172
|
+
```typescript
|
|
1173
|
+
import { RetellClient } from "retell-sdk";
|
|
1174
|
+
|
|
1175
|
+
(async () => {
|
|
1176
|
+
const sdk = new RetellClient({
|
|
1177
|
+
apiKey: "",
|
|
1178
|
+
});
|
|
1179
|
+
|
|
1180
|
+
const res = await sdk.createAgent({
|
|
1181
|
+
agentName: "Jarvis",
|
|
1182
|
+
beginMessage: "Hello there, how can I help you?",
|
|
1183
|
+
enableBeginMessage: true,
|
|
1184
|
+
enableEndCall: true,
|
|
1185
|
+
enableEndMessage: false,
|
|
1186
|
+
endMessage: "Hope you have a good day, goodbye.",
|
|
1187
|
+
prompt: "You are a marketing assistant. You help come up with creative content ideas and content like marketing emails, blog posts, tweets, ad copy and product descriptions. You respond concisely, with filler words in it.",
|
|
1188
|
+
voiceId: "elevenlabs-xxcrwXReTKMHWjqi7Q27",
|
|
1189
|
+
});
|
|
1190
|
+
|
|
1191
|
+
if (res.statusCode == 200) {
|
|
1192
|
+
// handle response
|
|
1193
|
+
}
|
|
1194
|
+
})();
|
|
1195
|
+
|
|
1196
|
+
```
|
|
1197
|
+
<!-- End Authentication -->
|
|
1198
|
+
|
|
623
1199
|
<!-- Placeholder for Future Speakeasy SDK Sections -->
|
|
624
1200
|
|
|
625
1201
|
# Development
|