github.com/twilio/twilio-go@v1.20.1/rest/api/v2010/docs/AccountsCallsApi.md (about) 1 # AccountsCallsApi 2 3 All URIs are relative to *https://api.twilio.com* 4 5 Method | HTTP request | Description 6 ------------- | ------------- | ------------- 7 [**CreateCall**](AccountsCallsApi.md#CreateCall) | **Post** /2010-04-01/Accounts/{AccountSid}/Calls.json | 8 [**DeleteCall**](AccountsCallsApi.md#DeleteCall) | **Delete** /2010-04-01/Accounts/{AccountSid}/Calls/{Sid}.json | 9 [**FetchCall**](AccountsCallsApi.md#FetchCall) | **Get** /2010-04-01/Accounts/{AccountSid}/Calls/{Sid}.json | 10 [**ListCall**](AccountsCallsApi.md#ListCall) | **Get** /2010-04-01/Accounts/{AccountSid}/Calls.json | 11 [**UpdateCall**](AccountsCallsApi.md#UpdateCall) | **Post** /2010-04-01/Accounts/{AccountSid}/Calls/{Sid}.json | 12 13 14 15 ## CreateCall 16 17 > ApiV2010Call CreateCall(ctx, optional) 18 19 20 21 Create a new outgoing call to phones, SIP-enabled endpoints or Twilio Client connections 22 23 ### Path Parameters 24 25 This endpoint does not need any path parameter. 26 27 ### Other Parameters 28 29 Other parameters are passed through a pointer to a CreateCallParams struct 30 31 32 Name | Type | Description 33 ------------- | ------------- | ------------- 34 **PathAccountSid** | **string** | The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. 35 **To** | **string** | The phone number, SIP address, or client identifier to call. 36 **From** | **string** | The phone number or client identifier to use as the caller id. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `From` must also be a phone number. 37 **Method** | **string** | The HTTP method we should use when calling the `url` parameter's value. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. 38 **FallbackUrl** | **string** | The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. 39 **FallbackMethod** | **string** | The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. 40 **StatusCallback** | **string** | The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). 41 **StatusCallbackEvent** | **[]string** | The call progress events that we will send to the `status_callback` URL. Can be: `initiated`, `ringing`, `answered`, and `completed`. If no event is specified, we send the `completed` status. If you want to receive multiple events, specify each one in a separate `status_callback_event` parameter. See the code sample for [monitoring call progress](https://www.twilio.com/docs/voice/api/call-resource?code-sample=code-create-a-call-resource-and-specify-a-statuscallbackevent&code-sdk-version=json). If an `application_sid` is present, this parameter is ignored. 42 **StatusCallbackMethod** | **string** | The HTTP method we should use when calling the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. 43 **SendDigits** | **string** | A string of keys to dial after connecting to the number, maximum of 32 digits. Valid digits in the string include: any digit (`0`-`9`), '`#`', '`*`' and '`w`', to insert a half second pause. For example, if you connected to a company phone number and wanted to pause for one second, and then dial extension 1234 followed by the pound key, the value of this parameter would be `ww1234#`. Remember to URL-encode this string, since the '`#`' character has special meaning in a URL. If both `SendDigits` and `MachineDetection` parameters are provided, then `MachineDetection` will be ignored. 44 **Timeout** | **int** | The integer number of seconds that we should allow the phone to ring before assuming there is no answer. The default is `60` seconds and the maximum is `600` seconds. For some call flows, we will add a 5-second buffer to the timeout value you provide. For this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds. You can set this to a short time, such as `15` seconds, to hang up before reaching an answering machine or voicemail. 45 **Record** | **bool** | Whether to record the call. Can be `true` to record the phone call, or `false` to not. The default is `false`. The `recording_url` is sent to the `status_callback` URL. 46 **RecordingChannels** | **string** | The number of channels in the final recording. Can be: `mono` or `dual`. The default is `mono`. `mono` records both legs of the call in a single channel of the recording file. `dual` records each leg to a separate channel of the recording file. The first channel of a dual-channel recording contains the parent call and the second channel contains the child call. 47 **RecordingStatusCallback** | **string** | The URL that we call when the recording is available to be accessed. 48 **RecordingStatusCallbackMethod** | **string** | The HTTP method we should use when calling the `recording_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. 49 **SipAuthUsername** | **string** | The username used to authenticate the caller making a SIP call. 50 **SipAuthPassword** | **string** | The password required to authenticate the user account specified in `sip_auth_username`. 51 **MachineDetection** | **string** | Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. If `send_digits` is provided, this parameter is ignored. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). 52 **MachineDetectionTimeout** | **int** | The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. 53 **RecordingStatusCallbackEvent** | **[]string** | The recording status events that will trigger calls to the URL specified in `recording_status_callback`. Can be: `in-progress`, `completed` and `absent`. Defaults to `completed`. Separate multiple values with a space. 54 **Trim** | **string** | Whether to trim any leading and trailing silence from the recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. 55 **CallerId** | **string** | The phone number, SIP address, or Client identifier that made this call. Phone numbers are in [E.164 format](https://wwnw.twilio.com/docs/glossary/what-e164) (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. 56 **MachineDetectionSpeechThreshold** | **int** | The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. 57 **MachineDetectionSpeechEndThreshold** | **int** | The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. 58 **MachineDetectionSilenceTimeout** | **int** | The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. 59 **AsyncAmd** | **string** | Select whether to perform answering machine detection in the background. Default, blocks the execution of the call until Answering Machine Detection is completed. Can be: `true` or `false`. 60 **AsyncAmdStatusCallback** | **string** | The URL that we should call using the `async_amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. 61 **AsyncAmdStatusCallbackMethod** | **string** | The HTTP method we should use when calling the `async_amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. 62 **Byoc** | **string** | The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) 63 **CallReason** | **string** | The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) 64 **CallToken** | **string** | A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. 65 **RecordingTrack** | **string** | The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. 66 **TimeLimit** | **int** | The maximum duration of the call in seconds. Constraints depend on account and configuration. 67 **Url** | **string** | The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). 68 **Twiml** | **string** | TwiML instructions for the call Twilio will use without fetching Twiml from url parameter. If both `twiml` and `url` are provided then `twiml` parameter will be ignored. Max 4000 characters. 69 **ApplicationSid** | **string** | The SID of the Application resource that will handle the call, if the call will be handled by an application. 70 71 ### Return type 72 73 [**ApiV2010Call**](ApiV2010Call.md) 74 75 ### Authorization 76 77 [accountSid_authToken](../README.md#accountSid_authToken) 78 79 ### HTTP request headers 80 81 - **Content-Type**: application/x-www-form-urlencoded 82 - **Accept**: application/json 83 84 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 85 [[Back to Model list]](../README.md#documentation-for-models) 86 [[Back to README]](../README.md) 87 88 89 ## DeleteCall 90 91 > DeleteCall(ctx, Sidoptional) 92 93 94 95 Delete a Call record from your account. Once the record is deleted, it will no longer appear in the API and Account Portal logs. 96 97 ### Path Parameters 98 99 100 Name | Type | Description 101 ------------- | ------------- | ------------- 102 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 103 **Sid** | **string** | The Twilio-provided Call SID that uniquely identifies the Call resource to delete 104 105 ### Other Parameters 106 107 Other parameters are passed through a pointer to a DeleteCallParams struct 108 109 110 Name | Type | Description 111 ------------- | ------------- | ------------- 112 **PathAccountSid** | **string** | The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Call resource(s) to delete. 113 114 ### Return type 115 116 (empty response body) 117 118 ### Authorization 119 120 [accountSid_authToken](../README.md#accountSid_authToken) 121 122 ### HTTP request headers 123 124 - **Content-Type**: Not defined 125 - **Accept**: Not defined 126 127 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 128 [[Back to Model list]](../README.md#documentation-for-models) 129 [[Back to README]](../README.md) 130 131 132 ## FetchCall 133 134 > ApiV2010Call FetchCall(ctx, Sidoptional) 135 136 137 138 Fetch the call specified by the provided Call SID 139 140 ### Path Parameters 141 142 143 Name | Type | Description 144 ------------- | ------------- | ------------- 145 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 146 **Sid** | **string** | The SID of the Call resource to fetch. 147 148 ### Other Parameters 149 150 Other parameters are passed through a pointer to a FetchCallParams struct 151 152 153 Name | Type | Description 154 ------------- | ------------- | ------------- 155 **PathAccountSid** | **string** | The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Call resource(s) to fetch. 156 157 ### Return type 158 159 [**ApiV2010Call**](ApiV2010Call.md) 160 161 ### Authorization 162 163 [accountSid_authToken](../README.md#accountSid_authToken) 164 165 ### HTTP request headers 166 167 - **Content-Type**: Not defined 168 - **Accept**: application/json 169 170 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 171 [[Back to Model list]](../README.md#documentation-for-models) 172 [[Back to README]](../README.md) 173 174 175 ## ListCall 176 177 > []ApiV2010Call ListCall(ctx, optional) 178 179 180 181 Retrieves a collection of calls made to and from your account 182 183 ### Path Parameters 184 185 This endpoint does not need any path parameter. 186 187 ### Other Parameters 188 189 Other parameters are passed through a pointer to a ListCallParams struct 190 191 192 Name | Type | Description 193 ------------- | ------------- | ------------- 194 **PathAccountSid** | **string** | The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Call resource(s) to read. 195 **To** | **string** | Only show calls made to this phone number, SIP address, Client identifier or SIM SID. 196 **From** | **string** | Only include calls from this phone number, SIP address, Client identifier or SIM SID. 197 **ParentCallSid** | **string** | Only include calls spawned by calls with this SID. 198 **Status** | **string** | The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. 199 **StartTime** | **time.Time** | Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. 200 **StartTimeBefore** | **time.Time** | Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. 201 **StartTimeAfter** | **time.Time** | Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. 202 **EndTime** | **time.Time** | Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. 203 **EndTimeBefore** | **time.Time** | Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. 204 **EndTimeAfter** | **time.Time** | Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. 205 **PageSize** | **int** | How many resources to return in each list page. The default is 50, and the maximum is 1000. 206 **Limit** | **int** | Max number of records to return. 207 208 ### Return type 209 210 [**[]ApiV2010Call**](ApiV2010Call.md) 211 212 ### Authorization 213 214 [accountSid_authToken](../README.md#accountSid_authToken) 215 216 ### HTTP request headers 217 218 - **Content-Type**: Not defined 219 - **Accept**: application/json 220 221 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 222 [[Back to Model list]](../README.md#documentation-for-models) 223 [[Back to README]](../README.md) 224 225 226 ## UpdateCall 227 228 > ApiV2010Call UpdateCall(ctx, Sidoptional) 229 230 231 232 Initiates a call redirect or terminates a call 233 234 ### Path Parameters 235 236 237 Name | Type | Description 238 ------------- | ------------- | ------------- 239 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 240 **Sid** | **string** | The Twilio-provided string that uniquely identifies the Call resource to update 241 242 ### Other Parameters 243 244 Other parameters are passed through a pointer to a UpdateCallParams struct 245 246 247 Name | Type | Description 248 ------------- | ------------- | ------------- 249 **PathAccountSid** | **string** | The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Call resource(s) to update. 250 **Url** | **string** | The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). 251 **Method** | **string** | The HTTP method we should use when calling the `url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. 252 **Status** | **string** | 253 **FallbackUrl** | **string** | The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. 254 **FallbackMethod** | **string** | The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. 255 **StatusCallback** | **string** | The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). 256 **StatusCallbackMethod** | **string** | The HTTP method we should use when requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. 257 **Twiml** | **string** | TwiML instructions for the call Twilio will use without fetching Twiml from url. Twiml and url parameters are mutually exclusive 258 **TimeLimit** | **int** | The maximum duration of the call in seconds. Constraints depend on account and configuration. 259 260 ### Return type 261 262 [**ApiV2010Call**](ApiV2010Call.md) 263 264 ### Authorization 265 266 [accountSid_authToken](../README.md#accountSid_authToken) 267 268 ### HTTP request headers 269 270 - **Content-Type**: application/x-www-form-urlencoded 271 - **Accept**: application/json 272 273 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 274 [[Back to Model list]](../README.md#documentation-for-models) 275 [[Back to README]](../README.md) 276