# Initiate a new bulk edit

POST https://api.close.com/api/v1/bulk_action/edit/
Content-Type: application/json

Pass additional parameters depending on which `type` is passed:

 - `set_lead_status` will set the Lead Status on all leads. It expects:
  - `lead_status_id` - ID of the Lead Status to use.
 - `clear_custom_field` will clear/remove/unset a specific custom field from all leads. It expects:
  - `custom_field_id` or `custom_field_name` - ID or exact name of the custom field to remove.
 - `set_custom_field` will set/update/add a specific custom field on all leads. It expects:
  - `custom_field_id` or `custom_field_name` - ID or exact name of the custom field to set/update.
  - `custom_field_value` - New value. Use `custom_field_values` to pass multiple values to custom fields that support it.
  - `custom_field_operation` - `replace`, `add`, or `remove` (defaults to `replace`). Only applicable for custom fields that accept multiple values.

Use `"send_done_email": false` if you don't want to get a confirmation email after the bulk action is done.

Reference: https://developer.close.com/api/resources/bulk-actions/edit/create

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Close API
  version: 1.0.0
paths:
  /bulk_action/edit/:
    post:
      operationId: create
      summary: Initiate a new bulk edit
      description: >-
        Pass additional parameters depending on which `type` is passed:

         - `set_lead_status` will set the Lead Status on all leads. It expects:
          - `lead_status_id` - ID of the Lead Status to use.
         - `clear_custom_field` will clear/remove/unset a specific custom field from all leads. It expects:
          - `custom_field_id` or `custom_field_name` - ID or exact name of the custom field to remove.
         - `set_custom_field` will set/update/add a specific custom field on all leads. It expects:
          - `custom_field_id` or `custom_field_name` - ID or exact name of the custom field to set/update.
          - `custom_field_value` - New value. Use `custom_field_values` to pass multiple values to custom fields that support it.
          - `custom_field_operation` - `replace`, `add`, or `remove` (defaults to `replace`). Only applicable for custom fields that accept multiple values.

        Use `"send_done_email": false` if you don't want to get a confirmation
        email after the bulk action is done.
      tags:
        - subpackage_bulkActionsEdit
      parameters:
        - name: Authorization
          in: header
          description: Basic authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkEditAction'
        '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:
              description: Any type
servers:
  - url: https://api.close.com/api/v1
components:
  schemas:
    BulkActionStatus:
      type: string
      enum:
        - created
        - loading
        - processing
        - done
        - paused
        - resuming
        - error
      title: BulkActionStatus
    BulkEditActionType:
      type: string
      enum:
        - set_custom_field
        - clear_custom_field
        - set_lead_status
        - set_contact_custom_field
        - clear_contact_custom_field
        - set_activity_custom_field
        - clear_activity_custom_field
        - set_global_custom_field
        - clear_global_custom_field
        - set_opportunity_custom_field
        - clear_opportunity_custom_field
        - set_custom_object_custom_field
        - clear_custom_object_custom_field
      title: BulkEditActionType
    BulkEditAction:
      type: object
      properties:
        created_by:
          type:
            - string
            - 'null'
        custom_field_name:
          type:
            - string
            - 'null'
        custom_field_value:
          type:
            - string
            - 'null'
        date_created:
          type:
            - string
            - 'null'
          format: date-time
        date_updated:
          type:
            - string
            - 'null'
          format: date-time
        id:
          type: string
        lead_status_id:
          type:
            - string
            - 'null'
        n_leads:
          type:
            - integer
            - 'null'
        n_leads_processed:
          type: integer
        n_objects:
          type:
            - integer
            - 'null'
        n_objects_processed:
          type: integer
        organization_id:
          type: string
        query:
          type:
            - string
            - 'null'
        results_limit:
          type:
            - integer
            - 'null'
        s_query:
          type: object
          additionalProperties:
            description: Any type
        send_done_email:
          type: boolean
        sort:
          type: array
          items:
            type: object
            additionalProperties:
              description: Any type
        status:
          oneOf:
            - $ref: '#/components/schemas/BulkActionStatus'
            - type: 'null'
        type:
          $ref: '#/components/schemas/BulkEditActionType'
        updated_by:
          type:
            - string
            - 'null'
      required:
        - created_by
        - custom_field_name
        - custom_field_value
        - date_created
        - date_updated
        - id
        - lead_status_id
        - n_leads
        - n_leads_processed
        - n_objects
        - n_objects_processed
        - organization_id
        - query
        - results_limit
        - s_query
        - send_done_email
        - sort
        - status
        - type
        - updated_by
      title: BulkEditAction
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: basic
    OAuth2:
      type: http
      scheme: bearer

```