retell-sdk 1.15.11 → 1.15.12
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 +245 -459
- 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 +178 -0
- package/dist/internal/utils/requestbody.d.ts +2 -0
- package/dist/internal/utils/requestbody.js +318 -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 +188 -0
- package/dist/internal/utils/utils.d.ts +37 -0
- package/dist/internal/utils/utils.js +370 -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/{models → dist/sdk/models}/errors/index.d.ts +1 -2
- package/{models → dist/sdk/models}/errors/index.js +1 -2
- 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/{models → dist/sdk/models}/operations/index.d.ts +0 -1
- package/{models → dist/sdk/models}/operations/index.js +0 -1
- 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/{models/components → dist/sdk/models/shared}/agent.d.ts +5 -35
- package/dist/sdk/models/shared/agent.js +90 -0
- package/{models/components → dist/sdk/models/shared}/agentnodefaultnorequired.d.ts +10 -36
- 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/{models/components → dist/sdk/models/shared}/index.d.ts +0 -1
- package/{models/components → dist/sdk/models/shared}/index.js +0 -1
- package/{models/components → dist/sdk/models/shared}/phonenumber.d.ts +2 -22
- 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/docs/models/errors/createagent400applicationjson.md +11 -0
- package/docs/models/errors/createagent401applicationjson.md +11 -0
- package/docs/models/errors/createagent422applicationjson.md +11 -0
- package/docs/models/errors/createagent500applicationjson.md +11 -0
- package/docs/models/errors/createphonecall400applicationjson.md +11 -0
- package/docs/models/errors/createphonecall401applicationjson.md +11 -0
- package/docs/models/errors/createphonecall402applicationjson.md +11 -0
- package/docs/models/errors/createphonecall422applicationjson.md +11 -0
- package/docs/models/errors/createphonecall429applicationjson.md +11 -0
- package/docs/models/errors/createphonecall500applicationjson.md +11 -0
- package/docs/models/errors/createphonenumber400applicationjson.md +11 -0
- package/docs/models/errors/createphonenumber401applicationjson.md +11 -0
- package/docs/models/errors/createphonenumber402applicationjson.md +11 -0
- package/docs/models/errors/createphonenumber422applicationjson.md +11 -0
- package/docs/models/errors/createphonenumber500applicationjson.md +11 -0
- package/docs/models/errors/deleteagent400applicationjson.md +11 -0
- package/docs/models/errors/deleteagent401applicationjson.md +11 -0
- package/docs/models/errors/deleteagent422applicationjson.md +11 -0
- package/docs/models/errors/deleteagent500applicationjson.md +11 -0
- package/docs/models/errors/deletephonenumber400applicationjson.md +11 -0
- package/docs/models/errors/deletephonenumber401applicationjson.md +11 -0
- package/docs/models/errors/deletephonenumber422applicationjson.md +11 -0
- package/docs/models/errors/deletephonenumber500applicationjson.md +11 -0
- package/docs/models/errors/getagent400applicationjson.md +11 -0
- package/docs/models/errors/getagent401applicationjson.md +11 -0
- package/docs/models/errors/getagent422applicationjson.md +11 -0
- package/docs/models/errors/getagent500applicationjson.md +11 -0
- package/docs/models/errors/getcall400applicationjson.md +11 -0
- package/docs/models/errors/getcall401applicationjson.md +11 -0
- package/docs/models/errors/getcall422applicationjson.md +11 -0
- package/docs/models/errors/getcall500applicationjson.md +11 -0
- package/docs/models/errors/getphonenumber400applicationjson.md +11 -0
- package/docs/models/errors/getphonenumber401applicationjson.md +11 -0
- package/docs/models/errors/getphonenumber422applicationjson.md +11 -0
- package/docs/models/errors/getphonenumber500applicationjson.md +11 -0
- package/docs/models/errors/listagents401applicationjson.md +11 -0
- package/docs/models/errors/listagents500applicationjson.md +11 -0
- package/docs/models/errors/listcalls400applicationjson.md +11 -0
- package/docs/models/errors/listcalls401applicationjson.md +11 -0
- package/docs/models/errors/listcalls500applicationjson.md +11 -0
- package/docs/models/errors/listphonenumbers400applicationjson.md +11 -0
- package/docs/models/errors/listphonenumbers401applicationjson.md +11 -0
- package/docs/models/errors/listphonenumbers500applicationjson.md +11 -0
- package/docs/models/errors/updateagent400applicationjson.md +11 -0
- package/docs/models/errors/updateagent401applicationjson.md +11 -0
- package/docs/models/errors/updateagent422applicationjson.md +11 -0
- package/docs/models/errors/updateagent500applicationjson.md +11 -0
- package/docs/models/errors/updatephoneagent400applicationjson.md +11 -0
- package/docs/models/errors/updatephoneagent401applicationjson.md +11 -0
- package/docs/models/errors/updatephoneagent422applicationjson.md +11 -0
- package/docs/models/errors/updatephoneagent500applicationjson.md +11 -0
- package/docs/models/operations/createagentrequestbody.md +15 -0
- package/docs/models/operations/createagentresponse.md +11 -0
- package/docs/models/operations/createphonecall201applicationjson.md +16 -0
- package/docs/models/operations/createphonecall201applicationjsoncallstatus.md +12 -0
- package/docs/models/operations/createphonecall201applicationjsoncalltype.md +12 -0
- package/docs/models/operations/createphonecallrequestbody.md +9 -0
- package/docs/models/operations/createphonecallrequestbodyphonenumber.md +11 -0
- package/docs/models/operations/createphonecallresponse.md +11 -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/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/listcallsfiltercriteria.md +13 -0
- package/docs/models/operations/listcallsfiltercriteriacalltype.md +10 -0
- package/docs/models/operations/listcallsrequest.md +10 -0
- package/docs/models/operations/listcallsresponse.md +11 -0
- package/docs/models/operations/listcallssortorder.md +11 -0
- package/docs/models/operations/listphonenumbersresponse.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/models/shared/agent.md +17 -0
- package/docs/models/shared/agentnodefaultnorequired.md +15 -0
- package/docs/models/shared/agentpromptparams.md +9 -0
- package/docs/models/shared/calldetail.md +17 -0
- package/docs/models/shared/calldetailcallstatus.md +12 -0
- package/docs/models/shared/calldetailcalltype.md +12 -0
- package/docs/models/shared/callphonenumber.md +11 -0
- package/docs/models/shared/phonenumber.md +12 -0
- package/docs/models/shared/security.md +8 -0
- package/docs/sdks/retellclient/README.md +214 -352
- package/package.json +20 -26
- 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/index.ts +0 -11
- 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/index.ts +0 -18
- 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/index.ts +0 -17
- 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,432 +2,376 @@
|
|
|
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
|
|
|
7
|
+
<!-- Start SDK Installation -->
|
|
8
|
+
# SDK Installation
|
|
10
9
|
|
|
11
|
-
##
|
|
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
|
-
<!-- Start SDK Installation [installation] -->
|
|
20
|
-
## SDK Installation
|
|
21
|
-
|
|
22
|
-
### NPM
|
|
10
|
+
## NPM
|
|
23
11
|
|
|
24
12
|
```bash
|
|
25
|
-
npm add
|
|
13
|
+
npm add <UNSET>
|
|
26
14
|
```
|
|
27
15
|
|
|
28
|
-
|
|
16
|
+
## Yarn
|
|
29
17
|
|
|
30
18
|
```bash
|
|
31
|
-
yarn add
|
|
19
|
+
yarn add <UNSET>
|
|
32
20
|
```
|
|
33
|
-
<!-- End SDK Installation
|
|
21
|
+
<!-- End SDK Installation -->
|
|
34
22
|
|
|
35
|
-
<!-- Start SDK Example Usage [usage] -->
|
|
36
23
|
## SDK Example Usage
|
|
24
|
+
<!-- Start SDK Example Usage -->
|
|
37
25
|
|
|
38
|
-
|
|
39
|
-
|
|
26
|
+
# Create a new voice AI agent
|
|
40
27
|
Create a new agent
|
|
41
|
-
|
|
42
28
|
```typescript
|
|
43
29
|
import { RetellClient } from "retell-sdk";
|
|
44
30
|
|
|
45
|
-
async
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
agentName: "Jarvis",
|
|
52
|
-
beginMessage: "Hello there, how can I help you?",
|
|
53
|
-
enableBeginMessage: true,
|
|
54
|
-
enableEndCall: true,
|
|
55
|
-
enableEndMessage: false,
|
|
56
|
-
endMessage: "Hope you have a good day, goodbye.",
|
|
57
|
-
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.",
|
|
58
|
-
voiceId: "elevenlabs-xxcrwXReTKMHWjqi7Q27",
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
if (res?.statusCode !== 200) {
|
|
62
|
-
throw new Error("Unexpected status code: " + res?.statusCode || "-");
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// handle response
|
|
66
|
-
}
|
|
31
|
+
(async() => {
|
|
32
|
+
const sdk = new RetellClient({
|
|
33
|
+
security: {
|
|
34
|
+
apiKey: "",
|
|
35
|
+
},
|
|
36
|
+
});
|
|
67
37
|
|
|
68
|
-
|
|
38
|
+
const res = await sdk.createAgent({
|
|
39
|
+
agentName: "Jarvis",
|
|
40
|
+
beginMessage: "Hello there, how can I help you?",
|
|
41
|
+
enableBeginMessage: true,
|
|
42
|
+
enableEndCall: true,
|
|
43
|
+
enableEndMessage: false,
|
|
44
|
+
endMessage: "Hope you have a good day, goodbye.",
|
|
45
|
+
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.",
|
|
46
|
+
voiceId: "elevenlabs-xxcrwXReTKMHWjqi7Q27",
|
|
47
|
+
});
|
|
69
48
|
|
|
49
|
+
if (res.statusCode == 200) {
|
|
50
|
+
// handle response
|
|
51
|
+
}
|
|
52
|
+
})();
|
|
70
53
|
```
|
|
71
54
|
|
|
72
|
-
### Create an outbound phone call
|
|
73
55
|
|
|
56
|
+
# Create an outbound phone call
|
|
74
57
|
Initiate an outbound phone call.
|
|
75
|
-
|
|
76
58
|
```typescript
|
|
77
59
|
import { RetellClient } from "retell-sdk";
|
|
78
60
|
|
|
79
|
-
async
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
agentPromptParams: [
|
|
86
|
-
{
|
|
87
|
-
name: "username",
|
|
88
|
-
value: "Adam",
|
|
89
|
-
},
|
|
90
|
-
],
|
|
91
|
-
phoneNumber: {
|
|
92
|
-
from: "+14159095857",
|
|
93
|
-
to: "+14159095858",
|
|
94
|
-
},
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
if (res?.statusCode !== 200) {
|
|
98
|
-
throw new Error("Unexpected status code: " + res?.statusCode || "-");
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// handle response
|
|
102
|
-
}
|
|
61
|
+
(async() => {
|
|
62
|
+
const sdk = new RetellClient({
|
|
63
|
+
security: {
|
|
64
|
+
apiKey: "",
|
|
65
|
+
},
|
|
66
|
+
});
|
|
103
67
|
|
|
104
|
-
|
|
68
|
+
const res = await sdk.createPhoneCall({
|
|
69
|
+
agentPromptParams: [
|
|
70
|
+
{
|
|
71
|
+
name: "username",
|
|
72
|
+
value: "Adam",
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
phoneNumber: {
|
|
76
|
+
from: "+14159095857",
|
|
77
|
+
to: "+14159095858",
|
|
78
|
+
},
|
|
79
|
+
});
|
|
105
80
|
|
|
81
|
+
if (res.statusCode == 200) {
|
|
82
|
+
// handle response
|
|
83
|
+
}
|
|
84
|
+
})();
|
|
106
85
|
```
|
|
107
86
|
|
|
108
|
-
### Create a new phone number
|
|
109
87
|
|
|
88
|
+
# Create a new phone number
|
|
110
89
|
Create a new phone number
|
|
111
|
-
|
|
112
90
|
```typescript
|
|
113
91
|
import { RetellClient } from "retell-sdk";
|
|
114
92
|
|
|
115
|
-
async
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
agentId: "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
|
|
122
|
-
areaCode: 415,
|
|
123
|
-
});
|
|
93
|
+
(async() => {
|
|
94
|
+
const sdk = new RetellClient({
|
|
95
|
+
security: {
|
|
96
|
+
apiKey: "",
|
|
97
|
+
},
|
|
98
|
+
});
|
|
124
99
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
100
|
+
const res = await sdk.createPhoneNumber({
|
|
101
|
+
agentId: "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
|
|
102
|
+
areaCode: 415,
|
|
103
|
+
});
|
|
128
104
|
|
|
105
|
+
if (res.statusCode == 200) {
|
|
129
106
|
// handle response
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
run();
|
|
133
|
-
|
|
107
|
+
}
|
|
108
|
+
})();
|
|
134
109
|
```
|
|
135
110
|
|
|
136
|
-
### Delete an existing agent
|
|
137
111
|
|
|
112
|
+
# Delete an existing agent
|
|
138
113
|
Delete an existing agent
|
|
139
|
-
|
|
140
114
|
```typescript
|
|
141
115
|
import { RetellClient } from "retell-sdk";
|
|
116
|
+
import { DeleteAgentRequest } from "retell-sdk/dist/sdk/models/operations";
|
|
142
117
|
|
|
143
|
-
async
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
const res = await sdk.deleteAgent(agentId);
|
|
118
|
+
(async() => {
|
|
119
|
+
const sdk = new RetellClient({
|
|
120
|
+
security: {
|
|
121
|
+
apiKey: "",
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
const agentId: string = "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD";
|
|
151
125
|
|
|
152
|
-
|
|
153
|
-
throw new Error("Unexpected status code: " + res?.statusCode || "-");
|
|
154
|
-
}
|
|
126
|
+
const res = await sdk.deleteAgent(agentId);
|
|
155
127
|
|
|
128
|
+
if (res.statusCode == 200) {
|
|
156
129
|
// handle response
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
run();
|
|
160
|
-
|
|
130
|
+
}
|
|
131
|
+
})();
|
|
161
132
|
```
|
|
162
133
|
|
|
163
|
-
### Delete a specific phone number
|
|
164
134
|
|
|
135
|
+
# Delete a specific phone number
|
|
165
136
|
Delete a specific phone number
|
|
166
|
-
|
|
167
137
|
```typescript
|
|
168
138
|
import { RetellClient } from "retell-sdk";
|
|
139
|
+
import { DeletePhoneNumberRequest } from "retell-sdk/dist/sdk/models/operations";
|
|
169
140
|
|
|
170
|
-
async
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
const res = await sdk.deletePhoneNumber(phoneNumber);
|
|
141
|
+
(async() => {
|
|
142
|
+
const sdk = new RetellClient({
|
|
143
|
+
security: {
|
|
144
|
+
apiKey: "",
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
const phoneNumber: string = "and";
|
|
178
148
|
|
|
179
|
-
|
|
180
|
-
throw new Error("Unexpected status code: " + res?.statusCode || "-");
|
|
181
|
-
}
|
|
149
|
+
const res = await sdk.deletePhoneNumber(phoneNumber);
|
|
182
150
|
|
|
151
|
+
if (res.statusCode == 200) {
|
|
183
152
|
// handle response
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
run();
|
|
187
|
-
|
|
153
|
+
}
|
|
154
|
+
})();
|
|
188
155
|
```
|
|
189
156
|
|
|
190
|
-
### Retrieve details of an agent
|
|
191
157
|
|
|
158
|
+
# Retrieve details of an agent
|
|
192
159
|
Retrieve details of a specific agent
|
|
193
|
-
|
|
194
160
|
```typescript
|
|
195
161
|
import { RetellClient } from "retell-sdk";
|
|
162
|
+
import { GetAgentRequest } from "retell-sdk/dist/sdk/models/operations";
|
|
196
163
|
|
|
197
|
-
async
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
const res = await sdk.getAgent(agentId);
|
|
164
|
+
(async() => {
|
|
165
|
+
const sdk = new RetellClient({
|
|
166
|
+
security: {
|
|
167
|
+
apiKey: "",
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
const agentId: string = "16b980523634a6dc504898cda492e939";
|
|
205
171
|
|
|
206
|
-
|
|
207
|
-
throw new Error("Unexpected status code: " + res?.statusCode || "-");
|
|
208
|
-
}
|
|
172
|
+
const res = await sdk.getAgent(agentId);
|
|
209
173
|
|
|
174
|
+
if (res.statusCode == 200) {
|
|
210
175
|
// handle response
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
run();
|
|
214
|
-
|
|
176
|
+
}
|
|
177
|
+
})();
|
|
215
178
|
```
|
|
216
179
|
|
|
217
|
-
### Retrieve a on-going or finished call
|
|
218
180
|
|
|
181
|
+
# Retrieve a on-going or finished call
|
|
219
182
|
Retrieve details of a specific call
|
|
220
|
-
|
|
221
183
|
```typescript
|
|
222
184
|
import { RetellClient } from "retell-sdk";
|
|
185
|
+
import { GetCallRequest } from "retell-sdk/dist/sdk/models/operations";
|
|
223
186
|
|
|
224
|
-
async
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
const res = await sdk.getCall(callId);
|
|
187
|
+
(async() => {
|
|
188
|
+
const sdk = new RetellClient({
|
|
189
|
+
security: {
|
|
190
|
+
apiKey: "",
|
|
191
|
+
},
|
|
192
|
+
});
|
|
193
|
+
const callId: string = "119c3f8e47135a29e65947eeb34cf12d";
|
|
232
194
|
|
|
233
|
-
|
|
234
|
-
throw new Error("Unexpected status code: " + res?.statusCode || "-");
|
|
235
|
-
}
|
|
195
|
+
const res = await sdk.getCall(callId);
|
|
236
196
|
|
|
197
|
+
if (res.statusCode == 200) {
|
|
237
198
|
// handle response
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
run();
|
|
241
|
-
|
|
199
|
+
}
|
|
200
|
+
})();
|
|
242
201
|
```
|
|
243
202
|
|
|
244
|
-
### Retrieve info about a specific number
|
|
245
203
|
|
|
204
|
+
# Retrieve info about a specific number
|
|
246
205
|
Retrieve info about a specific number
|
|
247
|
-
|
|
248
206
|
```typescript
|
|
249
207
|
import { RetellClient } from "retell-sdk";
|
|
208
|
+
import { GetPhoneNumberRequest } from "retell-sdk/dist/sdk/models/operations";
|
|
250
209
|
|
|
251
|
-
async
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
const res = await sdk.getPhoneNumber(phoneNumber);
|
|
210
|
+
(async() => {
|
|
211
|
+
const sdk = new RetellClient({
|
|
212
|
+
security: {
|
|
213
|
+
apiKey: "",
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
const phoneNumber: string = "+14159095857";
|
|
259
217
|
|
|
260
|
-
|
|
261
|
-
throw new Error("Unexpected status code: " + res?.statusCode || "-");
|
|
262
|
-
}
|
|
218
|
+
const res = await sdk.getPhoneNumber(phoneNumber);
|
|
263
219
|
|
|
220
|
+
if (res.statusCode == 200) {
|
|
264
221
|
// handle response
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
run();
|
|
268
|
-
|
|
222
|
+
}
|
|
223
|
+
})();
|
|
269
224
|
```
|
|
270
225
|
|
|
271
|
-
### List all agents
|
|
272
226
|
|
|
227
|
+
# List all agents
|
|
273
228
|
List all agents
|
|
274
|
-
|
|
275
229
|
```typescript
|
|
276
230
|
import { RetellClient } from "retell-sdk";
|
|
277
231
|
|
|
278
|
-
async
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
232
|
+
(async() => {
|
|
233
|
+
const sdk = new RetellClient({
|
|
234
|
+
security: {
|
|
235
|
+
apiKey: "",
|
|
236
|
+
},
|
|
237
|
+
});
|
|
284
238
|
|
|
285
|
-
|
|
286
|
-
throw new Error("Unexpected status code: " + res?.statusCode || "-");
|
|
287
|
-
}
|
|
239
|
+
const res = await sdk.listAgents();
|
|
288
240
|
|
|
241
|
+
if (res.statusCode == 200) {
|
|
289
242
|
// handle response
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
run();
|
|
293
|
-
|
|
243
|
+
}
|
|
244
|
+
})();
|
|
294
245
|
```
|
|
295
246
|
|
|
296
|
-
### List all web or phone calls
|
|
297
247
|
|
|
248
|
+
# List all web or phone calls
|
|
298
249
|
Retrieve call details
|
|
299
|
-
|
|
300
250
|
```typescript
|
|
301
251
|
import { RetellClient } from "retell-sdk";
|
|
302
|
-
import {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
252
|
+
import {
|
|
253
|
+
ListCallsFilterCriteria,
|
|
254
|
+
ListCallsFilterCriteriaCallType,
|
|
255
|
+
ListCallsRequest,
|
|
256
|
+
ListCallsSortOrder,
|
|
257
|
+
} from "retell-sdk/dist/sdk/models/operations";
|
|
258
|
+
|
|
259
|
+
(async() => {
|
|
260
|
+
const sdk = new RetellClient({
|
|
261
|
+
security: {
|
|
262
|
+
apiKey: "",
|
|
263
|
+
},
|
|
264
|
+
});
|
|
265
|
+
const filterCriteria: ListCallsFilterCriteria = {
|
|
266
|
+
afterEndTimestamp: 1703302428800,
|
|
267
|
+
afterStartTimestamp: 1703302407300,
|
|
268
|
+
agentId: [
|
|
269
|
+
"oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
|
|
270
|
+
],
|
|
271
|
+
beforeEndTimestamp: 1703302428899,
|
|
272
|
+
beforeStartTimestamp: 1703302407399,
|
|
273
|
+
callType: [
|
|
274
|
+
ListCallsFilterCriteriaCallType.InboundPhoneCall,
|
|
275
|
+
ListCallsFilterCriteriaCallType.OutboundPhoneCall,
|
|
276
|
+
],
|
|
277
|
+
};
|
|
278
|
+
const limit: number = 666195;
|
|
279
|
+
const sortOrder: ListCallsSortOrder = ListCallsSortOrder.Descending;
|
|
280
|
+
|
|
281
|
+
const res = await sdk.listCalls(filterCriteria, limit, sortOrder);
|
|
282
|
+
|
|
283
|
+
if (res.statusCode == 200) {
|
|
327
284
|
// handle response
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
run();
|
|
331
|
-
|
|
285
|
+
}
|
|
286
|
+
})();
|
|
332
287
|
```
|
|
333
288
|
|
|
334
|
-
### List all purchased and active phone numbers
|
|
335
289
|
|
|
290
|
+
# List all purchased and active phone numbers
|
|
336
291
|
List all purchased and active phone numbers
|
|
337
|
-
|
|
338
292
|
```typescript
|
|
339
293
|
import { RetellClient } from "retell-sdk";
|
|
340
294
|
|
|
341
|
-
async
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
295
|
+
(async() => {
|
|
296
|
+
const sdk = new RetellClient({
|
|
297
|
+
security: {
|
|
298
|
+
apiKey: "",
|
|
299
|
+
},
|
|
300
|
+
});
|
|
347
301
|
|
|
348
|
-
|
|
349
|
-
throw new Error("Unexpected status code: " + res?.statusCode || "-");
|
|
350
|
-
}
|
|
302
|
+
const res = await sdk.listPhoneNumbers();
|
|
351
303
|
|
|
304
|
+
if (res.statusCode == 200) {
|
|
352
305
|
// handle response
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
run();
|
|
356
|
-
|
|
306
|
+
}
|
|
307
|
+
})();
|
|
357
308
|
```
|
|
358
309
|
|
|
359
|
-
### Update an existing agent
|
|
360
310
|
|
|
311
|
+
# Update an existing agent
|
|
361
312
|
Update an existing agent
|
|
362
|
-
|
|
363
313
|
```typescript
|
|
364
314
|
import { RetellClient } from "retell-sdk";
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
315
|
+
import { UpdateAgentRequest } from "retell-sdk/dist/sdk/models/operations";
|
|
316
|
+
import { AgentNoDefaultNoRequired } from "retell-sdk/dist/sdk/models/shared";
|
|
317
|
+
|
|
318
|
+
(async() => {
|
|
319
|
+
const sdk = new RetellClient({
|
|
320
|
+
security: {
|
|
321
|
+
apiKey: "",
|
|
322
|
+
},
|
|
323
|
+
});
|
|
324
|
+
const agentNoDefaultNoRequired: AgentNoDefaultNoRequired = {
|
|
325
|
+
agentName: "Jarvis",
|
|
326
|
+
beginMessage: "Hello there, how can I help you.",
|
|
327
|
+
enableBeginMessage: true,
|
|
328
|
+
enableEndCall: true,
|
|
329
|
+
enableEndMessage: false,
|
|
330
|
+
endMessage: "Hope you have a good day, goodbye.",
|
|
331
|
+
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.",
|
|
332
|
+
voiceId: "elevenlabs-xxcrwXReTKMHWjqi7Q27",
|
|
333
|
+
};
|
|
334
|
+
const agentId: string = "16b980523634a6dc504898cda492e939";
|
|
335
|
+
|
|
336
|
+
const res = await sdk.updateAgent(agentNoDefaultNoRequired, agentId);
|
|
337
|
+
|
|
338
|
+
if (res.statusCode == 200) {
|
|
389
339
|
// handle response
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
run();
|
|
393
|
-
|
|
340
|
+
}
|
|
341
|
+
})();
|
|
394
342
|
```
|
|
395
343
|
|
|
396
|
-
### Update an existing phone number
|
|
397
344
|
|
|
345
|
+
# Update an existing phone number
|
|
398
346
|
Update an existing phone number
|
|
399
|
-
|
|
400
347
|
```typescript
|
|
401
348
|
import { RetellClient } from "retell-sdk";
|
|
349
|
+
import { UpdatePhoneAgentRequest, UpdatePhoneAgentRequestBody } from "retell-sdk/dist/sdk/models/operations";
|
|
402
350
|
|
|
403
|
-
async
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
const res = await sdk.updatePhoneAgent(requestBody, phoneNumber);
|
|
351
|
+
(async() => {
|
|
352
|
+
const sdk = new RetellClient({
|
|
353
|
+
security: {
|
|
354
|
+
apiKey: "",
|
|
355
|
+
},
|
|
356
|
+
});
|
|
357
|
+
const requestBody: UpdatePhoneAgentRequestBody = {
|
|
358
|
+
agentId: "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
|
|
359
|
+
};
|
|
360
|
+
const phoneNumber: string = "+14159095857";
|
|
414
361
|
|
|
415
|
-
|
|
416
|
-
throw new Error("Unexpected status code: " + res?.statusCode || "-");
|
|
417
|
-
}
|
|
362
|
+
const res = await sdk.updatePhoneAgent(requestBody, phoneNumber);
|
|
418
363
|
|
|
364
|
+
if (res.statusCode == 200) {
|
|
419
365
|
// handle response
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
run();
|
|
423
|
-
|
|
366
|
+
}
|
|
367
|
+
})();
|
|
424
368
|
```
|
|
425
|
-
<!-- End SDK Example Usage
|
|
369
|
+
<!-- End SDK Example Usage -->
|
|
426
370
|
|
|
427
|
-
<!-- Start Available
|
|
428
|
-
|
|
371
|
+
<!-- Start SDK Available Operations -->
|
|
372
|
+
# Available Resources and Operations
|
|
429
373
|
|
|
430
|
-
|
|
374
|
+
## [RetellClient SDK](docs/sdks/retellclient/README.md)
|
|
431
375
|
|
|
432
376
|
* [createAgent](docs/sdks/retellclient/README.md#createagent) - Create a new agent
|
|
433
377
|
* [createPhoneCall](docs/sdks/retellclient/README.md#createphonecall) - Initiate an outbound phone call.
|
|
@@ -442,183 +386,25 @@ run();
|
|
|
442
386
|
* [listPhoneNumbers](docs/sdks/retellclient/README.md#listphonenumbers) - List all purchased and active phone numbers
|
|
443
387
|
* [updateAgent](docs/sdks/retellclient/README.md#updateagent) - Update an existing agent
|
|
444
388
|
* [updatePhoneAgent](docs/sdks/retellclient/README.md#updatephoneagent) - Update an existing phone number
|
|
445
|
-
<!-- End Available
|
|
446
|
-
|
|
447
|
-
<!-- Start Error Handling [errors] -->
|
|
448
|
-
## Error Handling
|
|
449
|
-
|
|
450
|
-
All SDK methods 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
|
-
|
|
452
|
-
| Error Object | Status Code | Content Type |
|
|
453
|
-
| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- |
|
|
454
|
-
| errors.CreateAgentResponseBody | 400 | application/json |
|
|
455
|
-
| errors.CreateAgentResponseResponseBody | 401 | application/json |
|
|
456
|
-
| errors.CreateAgentResponse422ResponseBody | 422 | application/json |
|
|
457
|
-
| errors.CreateAgentResponse500ResponseBody | 500 | application/json |
|
|
458
|
-
| errors.SDKError | 4xx-5xx | */* |
|
|
459
|
-
|
|
460
|
-
Example
|
|
461
|
-
|
|
462
|
-
```typescript
|
|
463
|
-
import { RetellClient } from "retell-sdk";
|
|
464
|
-
import * as errors from "retell-sdk/models/errors";
|
|
465
|
-
|
|
466
|
-
async function run() {
|
|
467
|
-
const sdk = new RetellClient({
|
|
468
|
-
apiKey: "<YOUR_API_KEY_HERE>",
|
|
469
|
-
});
|
|
470
|
-
|
|
471
|
-
const res = await sdk
|
|
472
|
-
.createAgent({
|
|
473
|
-
agentName: "Jarvis",
|
|
474
|
-
beginMessage: "Hello there, how can I help you?",
|
|
475
|
-
enableBeginMessage: true,
|
|
476
|
-
enableEndCall: true,
|
|
477
|
-
enableEndMessage: false,
|
|
478
|
-
endMessage: "Hope you have a good day, goodbye.",
|
|
479
|
-
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
|
-
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
|
-
});
|
|
499
|
-
|
|
500
|
-
if (res?.statusCode !== 200) {
|
|
501
|
-
throw new Error("Unexpected status code: " + res?.statusCode || "-");
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
// handle response
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
run();
|
|
508
|
-
|
|
509
|
-
```
|
|
510
|
-
<!-- End Error Handling [errors] -->
|
|
511
|
-
|
|
512
|
-
<!-- Start Server Selection [server] -->
|
|
513
|
-
## Server Selection
|
|
514
|
-
|
|
515
|
-
### Select Server by Index
|
|
516
|
-
|
|
517
|
-
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:
|
|
518
|
-
|
|
519
|
-
| # | Server | Variables |
|
|
520
|
-
| - | ------ | --------- |
|
|
521
|
-
| 0 | `https://api.re-tell.ai` | None |
|
|
522
|
-
|
|
389
|
+
<!-- End SDK Available Operations -->
|
|
523
390
|
|
|
391
|
+
<!-- Start Dev Containers -->
|
|
524
392
|
|
|
525
393
|
|
|
526
|
-
### Override Server URL Per-Client
|
|
527
394
|
|
|
528
|
-
|
|
529
|
-
<!-- End Server Selection [server] -->
|
|
395
|
+
<!-- End Dev Containers -->
|
|
530
396
|
|
|
531
|
-
<!-- Start
|
|
532
|
-
|
|
397
|
+
<!-- Start Pagination -->
|
|
398
|
+
# Pagination
|
|
533
399
|
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
around the request lifecycle that can be used to modify the request or handle
|
|
538
|
-
errors and response.
|
|
400
|
+
Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the
|
|
401
|
+
returned response object will have a `next` method that can be called to pull down the next group of results. If the
|
|
402
|
+
return value of `next` is `null`, then there are no more pages to be fetched.
|
|
539
403
|
|
|
540
|
-
|
|
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
|
-
|
|
544
|
-
The following example shows how to use the `"beforeRequest"` hook to to add a
|
|
545
|
-
custom header and a timeout to requests and how to use the `"requestError"` hook
|
|
546
|
-
to log errors:
|
|
547
|
-
|
|
548
|
-
```typescript
|
|
549
|
-
import { RetellClient } from "retell-sdk";
|
|
550
|
-
import { HTTPClient } from "retell-sdk/lib/http";
|
|
551
|
-
|
|
552
|
-
const httpClient = new HTTPClient({
|
|
553
|
-
// fetcher takes a function that has the same signature as native `fetch`.
|
|
554
|
-
fetcher: (request) => {
|
|
555
|
-
return fetch(request);
|
|
556
|
-
}
|
|
557
|
-
});
|
|
558
|
-
|
|
559
|
-
httpClient.addHook("beforeRequest", (request) => {
|
|
560
|
-
const nextRequest = new Request(request, {
|
|
561
|
-
signal: request.signal || AbortSignal.timeout(5000);
|
|
562
|
-
});
|
|
404
|
+
Here's an example of one such pagination call:
|
|
563
405
|
|
|
564
|
-
nextRequest.headers.set("x-custom-header", "custom value");
|
|
565
406
|
|
|
566
|
-
|
|
567
|
-
});
|
|
568
|
-
|
|
569
|
-
httpClient.addHook("requestError", (error, request) => {
|
|
570
|
-
console.group("Request Error");
|
|
571
|
-
console.log("Reason:", `${error}`);
|
|
572
|
-
console.log("Endpoint:", `${request.method} ${request.url}`);
|
|
573
|
-
console.groupEnd();
|
|
574
|
-
});
|
|
575
|
-
|
|
576
|
-
const sdk = new RetellClient({ httpClient });
|
|
577
|
-
```
|
|
578
|
-
<!-- End Custom HTTP Client [http-client] -->
|
|
579
|
-
|
|
580
|
-
<!-- Start Authentication [security] -->
|
|
581
|
-
## Authentication
|
|
582
|
-
|
|
583
|
-
### Per-Client Security Schemes
|
|
584
|
-
|
|
585
|
-
This SDK supports the following security scheme globally:
|
|
586
|
-
|
|
587
|
-
| Name | Type | Scheme |
|
|
588
|
-
| -------- | -------- | -------- |
|
|
589
|
-
| `apiKey` | apiKey | API key |
|
|
590
|
-
|
|
591
|
-
To authenticate with the API the `apiKey` parameter must be set when initializing the SDK client instance. For example:
|
|
592
|
-
```typescript
|
|
593
|
-
import { RetellClient } from "retell-sdk";
|
|
594
|
-
|
|
595
|
-
async function run() {
|
|
596
|
-
const sdk = new RetellClient({
|
|
597
|
-
apiKey: "<YOUR_API_KEY_HERE>",
|
|
598
|
-
});
|
|
599
|
-
|
|
600
|
-
const res = await sdk.createAgent({
|
|
601
|
-
agentName: "Jarvis",
|
|
602
|
-
beginMessage: "Hello there, how can I help you?",
|
|
603
|
-
enableBeginMessage: true,
|
|
604
|
-
enableEndCall: true,
|
|
605
|
-
enableEndMessage: false,
|
|
606
|
-
endMessage: "Hope you have a good day, goodbye.",
|
|
607
|
-
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.",
|
|
608
|
-
voiceId: "elevenlabs-xxcrwXReTKMHWjqi7Q27",
|
|
609
|
-
});
|
|
610
|
-
|
|
611
|
-
if (res?.statusCode !== 200) {
|
|
612
|
-
throw new Error("Unexpected status code: " + res?.statusCode || "-");
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
// handle response
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
run();
|
|
619
|
-
|
|
620
|
-
```
|
|
621
|
-
<!-- End Authentication [security] -->
|
|
407
|
+
<!-- End Pagination -->
|
|
622
408
|
|
|
623
409
|
<!-- Placeholder for Future Speakeasy SDK Sections -->
|
|
624
410
|
|