> For a complete page index, fetch https://developer.close.com/llms.txt # Update a Smart View PUT https://api.close.com/api/v1/saved_search/{id}/ Content-Type: application/json Reference: https://developer.close.com/api/resources/smart-views/update ## Authentication - `Authorization` header (basic auth, required) — Use your API key as the username and leave the password empty. - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Request ### Path parameters - `id` (string, required) ### Body (application/json) This endpoint expects an any. - `any` ## Response ### 200 Successful response - `date_created` (datetime, required) - `date_updated` (datetime, required) - `description` (string, required, nullable) - `id` (string, required) - `is_shared` (boolean, required) - `is_user_dependent` (boolean, required, nullable) - `name` (string, required) - `organization_id` (string, required) - `query` (string, required, nullable) - `s_query` (map from string to any, required, nullable) - `type` (enum, required) - Allowed values: `lead`, `contact`, `opportunity`, `call`, `email`, `sms`, `meeting`, `note`, `whatsapp_message`, `custom_activity`, `form_submission` - `user_id` (string, required, nullable) - `selected_fields` (list of map from string to any, optional, nullable) - `shared_with` (list of string, optional, nullable) - `sharing_settings` (SharingSettingsEmbeddedResponse, optional, nullable) ## Errors ### 400 Bad Request Error Bad request - `any` ### 401 Unauthorized Error Unauthorized - `any` ### 404 Not Found Error Not found - `any` ## Types ### SharingSettingsEmbeddedResponse - `created_at` (datetime, required, nullable) - `created_by_id` (string, required, nullable) - `group_ids` (list of string, required) - `updated_at` (datetime, required, nullable) - `updated_by_id` (string, required, nullable) - `user_ids` (list of string, required) - `whole_org` (boolean, required) ## Examples **Request** ```json { "name": "every lead" } ``` **Response** ```json { "date_created": "2013-02-01T01:03:56.515000+00:00", "date_updated": "2013-02-01T01:03:56.515000+00:00", "description": "", "id": "save_wRlAku35U53xEV7PcNY3QodEHlgLPonBKkGFAxo9Ehb", "is_shared": false, "is_user_dependent": false, "name": "every lead", "organization_id": "orga_RbREgmiiwcr1w2b4cOnCMQaQPSIFxMqAD2Dh243uxcH", "query": null, "s_query": { "query": { "negate": false, "type": "match_all" }, "results_limit": null, "sort": [] }, "type": "lead", "user_id": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA", "used_recently": true } ``` **SDK Code** ```python import requests url = "https://api.close.com/api/v1/saved_search/:id/" payload = { "name": "every lead" } headers = { "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers, auth=("", "")) print(response.json()) ``` ```javascript const url = 'https://api.close.com/api/v1/saved_search/:id/'; const credentials = btoa(":"); const options = { method: 'PUT', headers: {Authorization: `Basic ${credentials}`, 'Content-Type': 'application/json'}, body: '{"name":"every lead"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.close.com/api/v1/saved_search/:id/" payload := strings.NewReader("{\n \"name\": \"every lead\"\n}") req, _ := http.NewRequest("PUT", url, payload) req.SetBasicAuth("", "") 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 require 'uri' require 'net/http' url = URI("https://api.close.com/api/v1/saved_search/:id/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Put.new(url) request.basic_auth("", "") request["Content-Type"] = 'application/json' request.body = "{\n \"name\": \"every lead\"\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.put("https://api.close.com/api/v1/saved_search/:id/") .basicAuth("", "") .header("Content-Type", "application/json") .body("{\n \"name\": \"every lead\"\n}") .asString(); ``` ```php request('PUT', 'https://api.close.com/api/v1/saved_search/:id/', [ 'body' => '{ "name": "every lead" }', 'headers' => [ 'Content-Type' => 'application/json', ], 'auth' => ['', ''], ]); echo $response->getBody(); ``` ```csharp using RestSharp; using RestSharp.Authenticators; var client = new RestClient("https://api.close.com/api/v1/saved_search/:id/"); client.Authenticator = new HttpBasicAuthenticator("", ""); var request = new RestRequest(Method.PUT); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"name\": \"every lead\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ```