Legs API
Authentication & Base URL
9 min
introduction exotel legs apis provide low level control over call legs, media, and bridges these apis are designed for advanced voice orchestration, real time call control, and custom contact center or voice workflows base url all legs apis are served from the exotel cpaas api host base url format https //cpaas api in exotel com/v2/accounts/{account sid} example https //cpaas api in exotel com/v2/accounts/ameyo5m important ameyo5m is an example account sid always use {account sid} as a placeholder how to get your api credentials to use the legs apis, developers must generate api credentials from the exotel dashboard steps log in to https //my exotel com go to developer settings → api settings copy account sid api key api token these credentials are required for all legs api requests authentication all legs apis use http basic authentication username api key password api token example curl u "\<api key> \<api token>" \\ https //cpaas api in exotel com/v2/accounts/\<account sid>/legs notes credentials are not embedded in the url credentials are not passed in request bodies every request must include basic authentication request format required headers content type application/json authorization basic \<base64(api key\ api token)> url structure /v2/accounts/{account sid}/{resource} common resources /legs /legs/{leg sid} /legs/{leg sid}/actions /bridges /bridges/{bridge sid} /bridges/{bridge sid}/actions example create a leg endpoint post /legs full url https //cpaas api in exotel com/v2/accounts/{account sid}/legs example request curl u "\<api key> \<api token>" \\ h "content type application/json" \\ x post \\ https //cpaas api in exotel com/v2/accounts/\<account sid>/legs \\ d '{ "contact uri" "09163816621", "exophone" "08030752400", "leg event endpoint" "grpc //127 0 0 1 9001" }' next steps once authentication is set up, you can create and manage call legs bridge multiple legs control media (play, say, record, stream) receive real time call events via grpc proceed to the legs api reference section to explore individual endpoints
Have a question?
Our super-smart AI, knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.
