github.com/twilio/twilio-go@v1.20.1/rest/conversations/v1/docs/ConversationsApi.md (about) 1 # ConversationsApi 2 3 All URIs are relative to *https://conversations.twilio.com* 4 5 Method | HTTP request | Description 6 ------------- | ------------- | ------------- 7 [**CreateConversation**](ConversationsApi.md#CreateConversation) | **Post** /v1/Conversations | 8 [**DeleteConversation**](ConversationsApi.md#DeleteConversation) | **Delete** /v1/Conversations/{Sid} | 9 [**FetchConversation**](ConversationsApi.md#FetchConversation) | **Get** /v1/Conversations/{Sid} | 10 [**ListConversation**](ConversationsApi.md#ListConversation) | **Get** /v1/Conversations | 11 [**UpdateConversation**](ConversationsApi.md#UpdateConversation) | **Post** /v1/Conversations/{Sid} | 12 13 14 15 ## CreateConversation 16 17 > ConversationsV1Conversation CreateConversation(ctx, optional) 18 19 20 21 Create a new conversation in your account's default service 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 CreateConversationParams struct 30 31 32 Name | Type | Description 33 ------------- | ------------- | ------------- 34 **XTwilioWebhookEnabled** | **string** | The X-Twilio-Webhook-Enabled HTTP request header 35 **FriendlyName** | **string** | The human-readable name of this conversation, limited to 256 characters. Optional. 36 **UniqueName** | **string** | An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. 37 **DateCreated** | **time.Time** | The date that this resource was created. 38 **DateUpdated** | **time.Time** | The date that this resource was last updated. 39 **MessagingServiceSid** | **string** | The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. 40 **Attributes** | **string** | An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. 41 **State** | **string** | 42 **TimersInactive** | **string** | ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. 43 **TimersClosed** | **string** | ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. 44 **BindingsEmailAddress** | **string** | The default email address that will be used when sending outbound emails in this conversation. 45 **BindingsEmailName** | **string** | The default name that will be used when sending outbound emails in this conversation. 46 47 ### Return type 48 49 [**ConversationsV1Conversation**](ConversationsV1Conversation.md) 50 51 ### Authorization 52 53 [accountSid_authToken](../README.md#accountSid_authToken) 54 55 ### HTTP request headers 56 57 - **Content-Type**: application/x-www-form-urlencoded 58 - **Accept**: application/json 59 60 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 61 [[Back to Model list]](../README.md#documentation-for-models) 62 [[Back to README]](../README.md) 63 64 65 ## DeleteConversation 66 67 > DeleteConversation(ctx, Sidoptional) 68 69 70 71 Remove a conversation from your account's default service 72 73 ### Path Parameters 74 75 76 Name | Type | Description 77 ------------- | ------------- | ------------- 78 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 79 **Sid** | **string** | A 34 character string that uniquely identifies this resource. Can also be the `unique_name` of the Conversation. 80 81 ### Other Parameters 82 83 Other parameters are passed through a pointer to a DeleteConversationParams struct 84 85 86 Name | Type | Description 87 ------------- | ------------- | ------------- 88 **XTwilioWebhookEnabled** | **string** | The X-Twilio-Webhook-Enabled HTTP request header 89 90 ### Return type 91 92 (empty response body) 93 94 ### Authorization 95 96 [accountSid_authToken](../README.md#accountSid_authToken) 97 98 ### HTTP request headers 99 100 - **Content-Type**: Not defined 101 - **Accept**: Not defined 102 103 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 104 [[Back to Model list]](../README.md#documentation-for-models) 105 [[Back to README]](../README.md) 106 107 108 ## FetchConversation 109 110 > ConversationsV1Conversation FetchConversation(ctx, Sid) 111 112 113 114 Fetch a conversation from your account's default service 115 116 ### Path Parameters 117 118 119 Name | Type | Description 120 ------------- | ------------- | ------------- 121 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 122 **Sid** | **string** | A 34 character string that uniquely identifies this resource. Can also be the `unique_name` of the Conversation. 123 124 ### Other Parameters 125 126 Other parameters are passed through a pointer to a FetchConversationParams struct 127 128 129 Name | Type | Description 130 ------------- | ------------- | ------------- 131 132 ### Return type 133 134 [**ConversationsV1Conversation**](ConversationsV1Conversation.md) 135 136 ### Authorization 137 138 [accountSid_authToken](../README.md#accountSid_authToken) 139 140 ### HTTP request headers 141 142 - **Content-Type**: Not defined 143 - **Accept**: application/json 144 145 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 146 [[Back to Model list]](../README.md#documentation-for-models) 147 [[Back to README]](../README.md) 148 149 150 ## ListConversation 151 152 > []ConversationsV1Conversation ListConversation(ctx, optional) 153 154 155 156 Retrieve a list of conversations in your account's default service 157 158 ### Path Parameters 159 160 This endpoint does not need any path parameter. 161 162 ### Other Parameters 163 164 Other parameters are passed through a pointer to a ListConversationParams struct 165 166 167 Name | Type | Description 168 ------------- | ------------- | ------------- 169 **StartDate** | **string** | Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. 170 **EndDate** | **string** | Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. 171 **State** | **string** | State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` 172 **PageSize** | **int** | How many resources to return in each list page. The default is 50, and the maximum is 1000. 173 **Limit** | **int** | Max number of records to return. 174 175 ### Return type 176 177 [**[]ConversationsV1Conversation**](ConversationsV1Conversation.md) 178 179 ### Authorization 180 181 [accountSid_authToken](../README.md#accountSid_authToken) 182 183 ### HTTP request headers 184 185 - **Content-Type**: Not defined 186 - **Accept**: application/json 187 188 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 189 [[Back to Model list]](../README.md#documentation-for-models) 190 [[Back to README]](../README.md) 191 192 193 ## UpdateConversation 194 195 > ConversationsV1Conversation UpdateConversation(ctx, Sidoptional) 196 197 198 199 Update an existing conversation in your account's default service 200 201 ### Path Parameters 202 203 204 Name | Type | Description 205 ------------- | ------------- | ------------- 206 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 207 **Sid** | **string** | A 34 character string that uniquely identifies this resource. Can also be the `unique_name` of the Conversation. 208 209 ### Other Parameters 210 211 Other parameters are passed through a pointer to a UpdateConversationParams struct 212 213 214 Name | Type | Description 215 ------------- | ------------- | ------------- 216 **XTwilioWebhookEnabled** | **string** | The X-Twilio-Webhook-Enabled HTTP request header 217 **FriendlyName** | **string** | The human-readable name of this conversation, limited to 256 characters. Optional. 218 **DateCreated** | **time.Time** | The date that this resource was created. 219 **DateUpdated** | **time.Time** | The date that this resource was last updated. 220 **Attributes** | **string** | An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. 221 **MessagingServiceSid** | **string** | The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. 222 **State** | **string** | 223 **TimersInactive** | **string** | ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. 224 **TimersClosed** | **string** | ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. 225 **UniqueName** | **string** | An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. 226 **BindingsEmailAddress** | **string** | The default email address that will be used when sending outbound emails in this conversation. 227 **BindingsEmailName** | **string** | The default name that will be used when sending outbound emails in this conversation. 228 229 ### Return type 230 231 [**ConversationsV1Conversation**](ConversationsV1Conversation.md) 232 233 ### Authorization 234 235 [accountSid_authToken](../README.md#accountSid_authToken) 236 237 ### HTTP request headers 238 239 - **Content-Type**: application/x-www-form-urlencoded 240 - **Accept**: application/json 241 242 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 243 [[Back to Model list]](../README.md#documentation-for-models) 244 [[Back to README]](../README.md) 245