> For a complete page index, fetch https://developer.close.com/llms.txt

# Bulk-update tasks

PUT https://api.close.com/api/v1/task/
Content-Type: application/json

Any of the filters of the GET endpoint may be used. For example, to update multiple tasks with given IDs A, B and C, `id__in=A,B,C` would be passed.

Only the `assigned_to`, `date` and `is_complete` fields may be updated.

Reference: https://developer.close.com/api/resources/tasks/bulk-update

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Close API
  version: 1.0.0
paths:
  /task/:
    put:
      operationId: bulk-update
      summary: Bulk-update tasks
      description: >-
        Any of the filters of the GET endpoint may be used. For example, to
        update multiple tasks with given IDs A, B and C, `id__in=A,B,C` would be
        passed.


        Only the `assigned_to`, `date` and `is_complete` fields may be updated.
      tags:
        - subpackage_tasks
      parameters:
        - name: assigned_to
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: format
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: id
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: id__in
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: is_complete
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: lead_id
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: _order_by
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: organization_id
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: _type
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: _type__in
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: view
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: date
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: date__lt
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: date__lte
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: date__gt
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: date__gte
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: due_date
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: due_date__lt
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: due_date__lte
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: due_date__gt
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: due_date__gte
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: date_created__lt
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: date_created__lte
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: date_created__gt
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: date_created__gte
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: date_updated__lt
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: date_updated__lte
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: date_updated__gt
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: date_updated__gte
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: _fields
          in: query
          description: Comma-separated list of fields to include in the response.
          required: false
          schema:
            type: string
        - name: Authorization
          in: header
          description: Use your API key as the username and leave the password empty.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tasks_bulkUpdate_Response_200'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                description: Any type
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                description: Any type
        '404':
          description: Not found
          content:
            application/json:
              schema:
                description: Any type
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkUpdateNotifications'
servers:
  - url: https://api.close.com/api/v1
components:
  schemas:
    BulkUpdateNotificationsDate:
      oneOf:
        - type: string
          format: date-time
        - type: string
          format: date
      title: BulkUpdateNotificationsDate
    TaskPriority:
      type: string
      enum:
        - high
        - medium
      title: TaskPriority
    NotificationResolution:
      type: string
      enum:
        - abandoned
        - skipped
      title: NotificationResolution
    BulkUpdateNotifications:
      type: object
      properties:
        assigned_to:
          type: string
        date:
          $ref: '#/components/schemas/BulkUpdateNotificationsDate'
        is_complete:
          type: boolean
        organization_id:
          type: string
        priority:
          $ref: '#/components/schemas/TaskPriority'
        resolution:
          oneOf:
            - $ref: '#/components/schemas/NotificationResolution'
            - type: 'null'
        text:
          type: string
      title: BulkUpdateNotifications
    tasks_bulkUpdate_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: tasks_bulkUpdate_Response_200
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: basic
      description: Use your API key as the username and leave the password empty.
    OAuth2:
      type: http
      scheme: bearer

```

## SDK Code Examples

```python tasks_bulkUpdate_example
import requests

url = "https://api.close.com/api/v1/task/"

payload = {
    "is_complete": True,
    "_params": { "id__in": "task_aRUZXCm9lMb2LwipTPhfFoFbCsUnaoQh1ncQ7WLnjlI,task_qhRXeZMdsZ4jxnBf589mpjE7BLb6lo5WTIEFMY7cbsf,task_pexvrlCZXiGlzvCp0HcnWcbBR0QNQwi0XFOKMqoUE8G" }
}
headers = {
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers, auth=("<CLOSE_API_KEY>", ""))

print(response.json())
```

```javascript tasks_bulkUpdate_example
const url = 'https://api.close.com/api/v1/task/';
const credentials = btoa("<CLOSE_API_KEY>:");

const options = {
  method: 'PUT',
  headers: {Authorization: `Basic ${credentials}`, 'Content-Type': 'application/json'},
  body: '{"is_complete":true,"_params":{"id__in":"task_aRUZXCm9lMb2LwipTPhfFoFbCsUnaoQh1ncQ7WLnjlI,task_qhRXeZMdsZ4jxnBf589mpjE7BLb6lo5WTIEFMY7cbsf,task_pexvrlCZXiGlzvCp0HcnWcbBR0QNQwi0XFOKMqoUE8G"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go tasks_bulkUpdate_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.close.com/api/v1/task/"

	payload := strings.NewReader("{\n  \"is_complete\": true,\n  \"_params\": {\n    \"id__in\": \"task_aRUZXCm9lMb2LwipTPhfFoFbCsUnaoQh1ncQ7WLnjlI,task_qhRXeZMdsZ4jxnBf589mpjE7BLb6lo5WTIEFMY7cbsf,task_pexvrlCZXiGlzvCp0HcnWcbBR0QNQwi0XFOKMqoUE8G\"\n  }\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.SetBasicAuth("<CLOSE_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 tasks_bulkUpdate_example
require 'uri'
require 'net/http'

url = URI("https://api.close.com/api/v1/task/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request.basic_auth("<CLOSE_API_KEY>", "")
request["Content-Type"] = 'application/json'
request.body = "{\n  \"is_complete\": true,\n  \"_params\": {\n    \"id__in\": \"task_aRUZXCm9lMb2LwipTPhfFoFbCsUnaoQh1ncQ7WLnjlI,task_qhRXeZMdsZ4jxnBf589mpjE7BLb6lo5WTIEFMY7cbsf,task_pexvrlCZXiGlzvCp0HcnWcbBR0QNQwi0XFOKMqoUE8G\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java tasks_bulkUpdate_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.close.com/api/v1/task/")
  .basicAuth("<CLOSE_API_KEY>", "")
  .header("Content-Type", "application/json")
  .body("{\n  \"is_complete\": true,\n  \"_params\": {\n    \"id__in\": \"task_aRUZXCm9lMb2LwipTPhfFoFbCsUnaoQh1ncQ7WLnjlI,task_qhRXeZMdsZ4jxnBf589mpjE7BLb6lo5WTIEFMY7cbsf,task_pexvrlCZXiGlzvCp0HcnWcbBR0QNQwi0XFOKMqoUE8G\"\n  }\n}")
  .asString();
```

```php tasks_bulkUpdate_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.close.com/api/v1/task/', [
  'body' => '{
  "is_complete": true,
  "_params": {
    "id__in": "task_aRUZXCm9lMb2LwipTPhfFoFbCsUnaoQh1ncQ7WLnjlI,task_qhRXeZMdsZ4jxnBf589mpjE7BLb6lo5WTIEFMY7cbsf,task_pexvrlCZXiGlzvCp0HcnWcbBR0QNQwi0XFOKMqoUE8G"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
    'auth' => ['<CLOSE_API_KEY>', ''],
]);

echo $response->getBody();
```

```csharp tasks_bulkUpdate_example
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://api.close.com/api/v1/task/");
client.Authenticator = new HttpBasicAuthenticator("<CLOSE_API_KEY>", "");
var request = new RestRequest(Method.PUT);

request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"is_complete\": true,\n  \"_params\": {\n    \"id__in\": \"task_aRUZXCm9lMb2LwipTPhfFoFbCsUnaoQh1ncQ7WLnjlI,task_qhRXeZMdsZ4jxnBf589mpjE7BLb6lo5WTIEFMY7cbsf,task_pexvrlCZXiGlzvCp0HcnWcbBR0QNQwi0XFOKMqoUE8G\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```