github.com/twilio/twilio-go@v1.20.1/rest/api/v2010/docs/AccountsUsageTriggersApi.md (about) 1 # AccountsUsageTriggersApi 2 3 All URIs are relative to *https://api.twilio.com* 4 5 Method | HTTP request | Description 6 ------------- | ------------- | ------------- 7 [**CreateUsageTrigger**](AccountsUsageTriggersApi.md#CreateUsageTrigger) | **Post** /2010-04-01/Accounts/{AccountSid}/Usage/Triggers.json | 8 [**DeleteUsageTrigger**](AccountsUsageTriggersApi.md#DeleteUsageTrigger) | **Delete** /2010-04-01/Accounts/{AccountSid}/Usage/Triggers/{Sid}.json | 9 [**FetchUsageTrigger**](AccountsUsageTriggersApi.md#FetchUsageTrigger) | **Get** /2010-04-01/Accounts/{AccountSid}/Usage/Triggers/{Sid}.json | 10 [**ListUsageTrigger**](AccountsUsageTriggersApi.md#ListUsageTrigger) | **Get** /2010-04-01/Accounts/{AccountSid}/Usage/Triggers.json | 11 [**UpdateUsageTrigger**](AccountsUsageTriggersApi.md#UpdateUsageTrigger) | **Post** /2010-04-01/Accounts/{AccountSid}/Usage/Triggers/{Sid}.json | 12 13 14 15 ## CreateUsageTrigger 16 17 > ApiV2010UsageTrigger CreateUsageTrigger(ctx, optional) 18 19 20 21 Create a new UsageTrigger 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 CreateUsageTriggerParams 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 **CallbackUrl** | **string** | The URL we should call using `callback_method` when the trigger fires. 36 **TriggerValue** | **string** | The usage value at which the trigger should fire. For convenience, you can use an offset value such as `+30` to specify a trigger_value that is 30 units more than the current usage value. Be sure to urlencode a `+` as `%2B`. 37 **UsageCategory** | **string** | 38 **CallbackMethod** | **string** | The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. 39 **FriendlyName** | **string** | A descriptive string that you create to describe the resource. It can be up to 64 characters long. 40 **Recurring** | **string** | 41 **TriggerBy** | **string** | 42 43 ### Return type 44 45 [**ApiV2010UsageTrigger**](ApiV2010UsageTrigger.md) 46 47 ### Authorization 48 49 [accountSid_authToken](../README.md#accountSid_authToken) 50 51 ### HTTP request headers 52 53 - **Content-Type**: application/x-www-form-urlencoded 54 - **Accept**: application/json 55 56 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 57 [[Back to Model list]](../README.md#documentation-for-models) 58 [[Back to README]](../README.md) 59 60 61 ## DeleteUsageTrigger 62 63 > DeleteUsageTrigger(ctx, Sidoptional) 64 65 66 67 68 69 ### Path Parameters 70 71 72 Name | Type | Description 73 ------------- | ------------- | ------------- 74 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 75 **Sid** | **string** | The Twilio-provided string that uniquely identifies the UsageTrigger resource to delete. 76 77 ### Other Parameters 78 79 Other parameters are passed through a pointer to a DeleteUsageTriggerParams struct 80 81 82 Name | Type | Description 83 ------------- | ------------- | ------------- 84 **PathAccountSid** | **string** | The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageTrigger resources to delete. 85 86 ### Return type 87 88 (empty response body) 89 90 ### Authorization 91 92 [accountSid_authToken](../README.md#accountSid_authToken) 93 94 ### HTTP request headers 95 96 - **Content-Type**: Not defined 97 - **Accept**: Not defined 98 99 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 100 [[Back to Model list]](../README.md#documentation-for-models) 101 [[Back to README]](../README.md) 102 103 104 ## FetchUsageTrigger 105 106 > ApiV2010UsageTrigger FetchUsageTrigger(ctx, Sidoptional) 107 108 109 110 Fetch and instance of a usage-trigger 111 112 ### Path Parameters 113 114 115 Name | Type | Description 116 ------------- | ------------- | ------------- 117 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 118 **Sid** | **string** | The Twilio-provided string that uniquely identifies the UsageTrigger resource to fetch. 119 120 ### Other Parameters 121 122 Other parameters are passed through a pointer to a FetchUsageTriggerParams struct 123 124 125 Name | Type | Description 126 ------------- | ------------- | ------------- 127 **PathAccountSid** | **string** | The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageTrigger resource to fetch. 128 129 ### Return type 130 131 [**ApiV2010UsageTrigger**](ApiV2010UsageTrigger.md) 132 133 ### Authorization 134 135 [accountSid_authToken](../README.md#accountSid_authToken) 136 137 ### HTTP request headers 138 139 - **Content-Type**: Not defined 140 - **Accept**: application/json 141 142 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 143 [[Back to Model list]](../README.md#documentation-for-models) 144 [[Back to README]](../README.md) 145 146 147 ## ListUsageTrigger 148 149 > []ApiV2010UsageTrigger ListUsageTrigger(ctx, optional) 150 151 152 153 Retrieve a list of usage-triggers belonging to the account used to make the request 154 155 ### Path Parameters 156 157 This endpoint does not need any path parameter. 158 159 ### Other Parameters 160 161 Other parameters are passed through a pointer to a ListUsageTriggerParams struct 162 163 164 Name | Type | Description 165 ------------- | ------------- | ------------- 166 **PathAccountSid** | **string** | The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageTrigger resources to read. 167 **Recurring** | **string** | The frequency of recurring UsageTriggers to read. Can be: `daily`, `monthly`, or `yearly` to read recurring UsageTriggers. An empty value or a value of `alltime` reads non-recurring UsageTriggers. 168 **TriggerBy** | **string** | The trigger field of the UsageTriggers to read. Can be: `count`, `usage`, or `price` as described in the [UsageRecords documentation](https://www.twilio.com/docs/usage/api/usage-record#usage-count-price). 169 **UsageCategory** | **string** | The usage category of the UsageTriggers to read. Must be a supported [usage categories](https://www.twilio.com/docs/usage/api/usage-record#usage-categories). 170 **PageSize** | **int** | How many resources to return in each list page. The default is 50, and the maximum is 1000. 171 **Limit** | **int** | Max number of records to return. 172 173 ### Return type 174 175 [**[]ApiV2010UsageTrigger**](ApiV2010UsageTrigger.md) 176 177 ### Authorization 178 179 [accountSid_authToken](../README.md#accountSid_authToken) 180 181 ### HTTP request headers 182 183 - **Content-Type**: Not defined 184 - **Accept**: application/json 185 186 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 187 [[Back to Model list]](../README.md#documentation-for-models) 188 [[Back to README]](../README.md) 189 190 191 ## UpdateUsageTrigger 192 193 > ApiV2010UsageTrigger UpdateUsageTrigger(ctx, Sidoptional) 194 195 196 197 Update an instance of a usage trigger 198 199 ### Path Parameters 200 201 202 Name | Type | Description 203 ------------- | ------------- | ------------- 204 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 205 **Sid** | **string** | The Twilio-provided string that uniquely identifies the UsageTrigger resource to update. 206 207 ### Other Parameters 208 209 Other parameters are passed through a pointer to a UpdateUsageTriggerParams struct 210 211 212 Name | Type | Description 213 ------------- | ------------- | ------------- 214 **PathAccountSid** | **string** | The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageTrigger resources to update. 215 **CallbackMethod** | **string** | The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. 216 **CallbackUrl** | **string** | The URL we should call using `callback_method` when the trigger fires. 217 **FriendlyName** | **string** | A descriptive string that you create to describe the resource. It can be up to 64 characters long. 218 219 ### Return type 220 221 [**ApiV2010UsageTrigger**](ApiV2010UsageTrigger.md) 222 223 ### Authorization 224 225 [accountSid_authToken](../README.md#accountSid_authToken) 226 227 ### HTTP request headers 228 229 - **Content-Type**: application/x-www-form-urlencoded 230 - **Accept**: application/json 231 232 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 233 [[Back to Model list]](../README.md#documentation-for-models) 234 [[Back to README]](../README.md) 235