# Update sender PUT https://alsona.com/rest/accounts/account_cd855c2bb1cc72097238/emails/senders/sender@example.com Content-Type: application/json Update sender details (email in path). **Request body fields (wrapped in `sender` object):** - `seat_id` (string, required) — Associated seat ID. - `account_id` (string, required) — Account this sender belongs to. - `status` (string, optional) — `ENABLED` | `DISABLED`. - `name` (string, optional) — Display name for this sender. Reference: https://api.hublinks.io/alsona-api/emails/update-sender ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: collection version: 1.0.0 paths: /rest/accounts/account_cd855c2bb1cc72097238/emails/senders/sender@example.com: put: operationId: update-sender summary: Update sender description: |- Update sender details (email in path). **Request body fields (wrapped in `sender` object):** - `seat_id` (string, required) — Associated seat ID. - `account_id` (string, required) — Account this sender belongs to. - `status` (string, optional) — `ENABLED` | `DISABLED`. - `name` (string, optional) — Display name for this sender. tags: - subpackage_emails parameters: - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/emails_Update sender_Response_200' '400': description: Bad Request content: application/json: schema: $ref: >- #/components/schemas/PutRestAccountsAccount_cd855c2bb1cc72097238EmailsSendersSender@example.comRequestBadRequestError '401': description: Unauthorized content: application/json: schema: $ref: >- #/components/schemas/PutRestAccountsAccount_cd855c2bb1cc72097238EmailsSendersSender@example.comRequestUnauthorizedError requestBody: content: application/json: schema: type: object properties: sender: $ref: >- #/components/schemas/RestAccountsAccountCd855C2Bb1Cc72097238EmailsSendersSenderExampleComPutRequestBodyContentApplicationJsonSchemaSender required: - sender servers: - url: https://alsona.com components: schemas: RestAccountsAccountCd855C2Bb1Cc72097238EmailsSendersSenderExampleComPutRequestBodyContentApplicationJsonSchemaSender: type: object properties: status: type: string seat_id: type: string account_id: type: string required: - status - seat_id - account_id title: >- RestAccountsAccountCd855C2Bb1Cc72097238EmailsSendersSenderExampleComPutRequestBodyContentApplicationJsonSchemaSender RestAccountsAccountCd855C2Bb1Cc72097238EmailsSendersSenderExampleComPutResponsesContentApplicationJsonSchemaAccountNew: type: object properties: name: type: string email: type: string format: email status: type: string seat_id: type: string account_id: type: string required: - name - email - status - seat_id - account_id title: >- RestAccountsAccountCd855C2Bb1Cc72097238EmailsSendersSenderExampleComPutResponsesContentApplicationJsonSchemaAccountNew RestAccountsAccountCd855C2Bb1Cc72097238EmailsSendersSenderExampleComPutResponsesContentApplicationJsonSchemaAccountOldOauth: type: object properties: scope: type: string format: uri id_token: type: string token_type: type: string expiry_date: type: integer access_token: type: string refresh_token: type: string required: - scope - id_token - token_type - expiry_date - access_token - refresh_token title: >- RestAccountsAccountCd855C2Bb1Cc72097238EmailsSendersSenderExampleComPutResponsesContentApplicationJsonSchemaAccountOldOauth RestAccountsAccountCd855C2Bb1Cc72097238EmailsSendersSenderExampleComPutResponsesContentApplicationJsonSchemaAccountOld: type: object properties: app: type: string name: type: string email: type: string format: email oauth: $ref: >- #/components/schemas/RestAccountsAccountCd855C2Bb1Cc72097238EmailsSendersSenderExampleComPutResponsesContentApplicationJsonSchemaAccountOldOauth status: type: string seat_id: type: string provider: type: string last_name: type: string wl_domain: type: string account_id: type: string created_at: type: integer first_name: type: string picture_url: type: string format: uri access_token: type: string refresh_token: type: string access_token_expire_at: type: integer refresh_token_updated_at: type: integer required: - app - name - email - oauth - status - seat_id - provider - last_name - wl_domain - account_id - created_at - first_name - picture_url - access_token - refresh_token - access_token_expire_at - refresh_token_updated_at title: >- RestAccountsAccountCd855C2Bb1Cc72097238EmailsSendersSenderExampleComPutResponsesContentApplicationJsonSchemaAccountOld emails_Update sender_Response_200: type: object properties: diff: type: boolean success: type: boolean account_new: $ref: >- #/components/schemas/RestAccountsAccountCd855C2Bb1Cc72097238EmailsSendersSenderExampleComPutResponsesContentApplicationJsonSchemaAccountNew account_old: $ref: >- #/components/schemas/RestAccountsAccountCd855C2Bb1Cc72097238EmailsSendersSenderExampleComPutResponsesContentApplicationJsonSchemaAccountOld required: - diff - success - account_new - account_old title: emails_Update sender_Response_200 PutRestAccountsAccount_cd855c2bb1cc72097238EmailsSendersSender@example.comRequestBadRequestError: type: object properties: error: type: string message: type: string required: - error - message title: >- PutRestAccountsAccount_cd855c2bb1cc72097238EmailsSendersSender@example.comRequestBadRequestError PutRestAccountsAccount_cd855c2bb1cc72097238EmailsSendersSender@example.comRequestUnauthorizedError: type: object properties: error: type: string message: type: string required: - error - message title: >- PutRestAccountsAccount_cd855c2bb1cc72097238EmailsSendersSender@example.comRequestUnauthorizedError securitySchemes: apiKeyAuth: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python emails_Update sender_example import requests url = "https://alsona.com/rest/accounts/account_cd855c2bb1cc72097238/emails/senders/sender@example.com" payload = { "sender": { "status": "DISABLED", "seat_id": "{{seat_id}}", "account_id": "{{account_id}}" } } headers = { "X-API-KEY": "", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```javascript emails_Update sender_example const url = 'https://alsona.com/rest/accounts/account_cd855c2bb1cc72097238/emails/senders/sender@example.com'; const options = { method: 'PUT', headers: {'X-API-KEY': '', 'Content-Type': 'application/json'}, body: '{"sender":{"status":"DISABLED","seat_id":"{{seat_id}}","account_id":"{{account_id}}"}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go emails_Update sender_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://alsona.com/rest/accounts/account_cd855c2bb1cc72097238/emails/senders/sender@example.com" payload := strings.NewReader("{\n \"sender\": {\n \"status\": \"DISABLED\",\n \"seat_id\": \"{{seat_id}}\",\n \"account_id\": \"{{account_id}}\"\n }\n}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("X-API-KEY", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby emails_Update sender_example require 'uri' require 'net/http' url = URI("https://alsona.com/rest/accounts/account_cd855c2bb1cc72097238/emails/senders/sender@example.com") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Put.new(url) request["X-API-KEY"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"sender\": {\n \"status\": \"DISABLED\",\n \"seat_id\": \"{{seat_id}}\",\n \"account_id\": \"{{account_id}}\"\n }\n}" response = http.request(request) puts response.read_body ``` ```java emails_Update sender_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.put("https://alsona.com/rest/accounts/account_cd855c2bb1cc72097238/emails/senders/sender@example.com") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"sender\": {\n \"status\": \"DISABLED\",\n \"seat_id\": \"{{seat_id}}\",\n \"account_id\": \"{{account_id}}\"\n }\n}") .asString(); ``` ```php emails_Update sender_example request('PUT', 'https://alsona.com/rest/accounts/account_cd855c2bb1cc72097238/emails/senders/sender@example.com', [ 'body' => '{ "sender": { "status": "DISABLED", "seat_id": "{{seat_id}}", "account_id": "{{account_id}}" } }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp emails_Update sender_example using RestSharp; var client = new RestClient("https://alsona.com/rest/accounts/account_cd855c2bb1cc72097238/emails/senders/sender@example.com"); var request = new RestRequest(Method.PUT); request.AddHeader("X-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"sender\": {\n \"status\": \"DISABLED\",\n \"seat_id\": \"{{seat_id}}\",\n \"account_id\": \"{{account_id}}\"\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift emails_Update sender_example import Foundation let headers = [ "X-API-KEY": "", "Content-Type": "application/json" ] let parameters = ["sender": [ "status": "DISABLED", "seat_id": "{{seat_id}}", "account_id": "{{account_id}}" ]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://alsona.com/rest/accounts/account_cd855c2bb1cc72097238/emails/senders/sender@example.com")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PUT" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```