openapi: 3.0.0
info:
  title: Lists
  description: Everything about creating and manipulating contact lists
servers:
  - url: https://rest.clicksend.com
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
  schemas:
    contact:
      type: object
      properties:
        contact_id:
          type: integer
          description: The unique identifier for the contact.
          example: 552786
        list_id:
          type: integer
          description: The identifier of the list the contact belongs to.
          example: 428
        phone_number:
          type: string
          description: The phone number of the contact.
          example: '+16783270696'
        first_name:
          type: string
          description: The first name of the contact.
          example: John
        last_name:
          type: string
          description: The last name of the contact.
          example: Doe
        custom_1:
          type: string
          description: Custom field 1.
          example: Custom 1
        custom_2:
          type: string
          description: Custom field 2.
          example: Custom 2
        custom_3:
          type: string
          description: Custom field 3.
          example: Custom 3
        custom_4:
          type: string
          description: Custom field 4.
          example: Custom 4
        date_added:
          type: string
          format: date-time
          description: The date when the contact was added.
          example: '2015-07-05T14:51:26Z'
        date_updated:
          type: string
          format: date-time
          description: The date when the contact was last updated.
          example: '2015-07-05T14:51:26Z'
        fax_number:
          type: string
          nullable: true
          description: The fax number of the contact.
          example: '+61477141888'
        organization_name:
          type: string
          nullable: true
          description: The organization name of the contact.
          example: Awesome Company
        email:
          type: string
          nullable: true
          description: The email address of the contact.
          example: john@doe.com
        address_line_1:
          type: string
          nullable: true
          description: The address line 1 of the contact.
          example: 1554 Buffalo Creek Road
        address_line_2:
          type: string
          nullable: true
          description: The address line 2 of the contact.
          example: null
        address_city:
          type: string
          nullable: true
          description: The address city of the contact.
          example: Nashville
        address_state:
          type: string
          nullable: true
          description: The address state of the contact.
          example: TN
        address_postal_code:
          type: string
          nullable: true
          description: The address postal code of the contact.
          example: '37214'
        address_country:
          type: string
          nullable: true
          description: The address country of the contact.
          example: US
        _list_name:
          type: string
          description: The name of the list the contact belongs to.
          example: List6eaG4lGIc9
    view-list-contacts:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here's your list of contacts.
        data:
          type: array
          items:
            $ref: '#/components/schemas/contact'
          example:
            - contact_id: 552786
              list_id: 428
              phone_number: '+16783270696'
              first_name: Ellen
              last_name: Diaz
              custom_1: ''
              custom_2: ''
              custom_3: ''
              custom_4: ''
              date_added: '1436157486'
              date_updated: '1436157486'
              fax_number: null
              organization_name: null
              email: null
              address_line_1: null
              address_line_2: null
              address_city: null
              address_state: null
              address_postal_code: null
              address_country: null
              _list_name: List6eaG4lGIc9
            - contact_id: 552787
              list_id: 428
              phone_number: '+16783270697'
              first_name: Ellen
              last_name: Diaz
              custom_1: ''
              custom_2: ''
              custom_3: ''
              custom_4: ''
              date_added: '1436157925'
              date_updated: '1436157925'
              fax_number: null
              organization_name: null
              email: null
              address_line_1: null
              address_line_2: null
              address_city: null
              address_state: null
              address_postal_code: null
              address_country: null
              _list_name: List6eaG4lGIc9
    create-new-contact:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here's your list of contacts.
        data:
          $ref: '#/components/schemas/contact'
    copy-contact-to-list:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: 'Contact #1 has been copied to List #429'
        data:
          $ref: '#/components/schemas/contact'
    transfer-contact-to-list:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: 'Contact #1 has been transferred to List #429'
        data:
          $ref: '#/components/schemas/contact'
    remove-opted-out-contacts:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Optout contacts has been deleted.
        data:
          type: object
          properties:
            deleted:
              type: number
              description: The number of contacts deleted.
              example: 6
    contact_list:
      type: object
      properties:
        list_id:
          type: integer
          description: The unique identifier for the list.
          example: 428
        list_name:
          type: string
          description: The name of the list.
          example: ListCT3QrVL4od
        list_email_id:
          type: string
          description: The email address id of the list.
          example: KB0LHD6WXFVHZWTR
        _contacts_count:
          type: integer
          description: The number of contacts in the list.
          example: 0
    view-lists:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here are your data.
        data:
          type: object
          properties:
            total:
              type: integer
              description: The total number of contacts in the list.
              example: 0
            per_page:
              type: integer
              description: The number of contacts returned per page.
              example: 10
            current_page:
              type: integer
              description: The current page number.
              example: 1
            last_page:
              type: integer
              description: The total number of pages.
              example: 2
            next_page_url:
              type: string
              description: The URL of the next page of contacts.
              example: https://api.clicksend.com/v3/lists?page=2
            prev_page_url:
              type: string
              description: The URL of the previous page of contacts.
              example: https://api.clicksend.com/v3/lists?page=1
            from:
              type: integer
              description: The number of the first contact on the current page.
              example: 1
            to:
              type: integer
              description: The number of the last contact on the current page.
              example: 10
            data:
              type: array
              description: The contacts in the list.
              items:
                $ref: '#/components/schemas/contact_list'
              example:
                - list_id: 428
                  list_name: ListCT3QrVL4od
                  list_email_id: KB0LHD6WXFVHZWTR
                  _contacts_count: 0
                - list_id: 429
                  list_name: ListCT3QrVL4od
                  list_email_id: KB0LHD6WXFVHZWTR
                  _contacts_count: 0
    create-list:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: New list has been created.
        data:
          $ref: '#/components/schemas/contact_list'
    view-specific-list:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here are your data.
        data:
          $ref: '#/components/schemas/contact_list'
    update-list:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: 'List #439 has been updated.'
        data:
          $ref: '#/components/schemas/contact_list'
    delete-list:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: 'List #442 has been deleted.'
        data:
          type: array
          items: []
          example: []
    remove-duplicate-contacts:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Your list duplicate contacts has been deleted.
        data:
          type: object
          properties:
            deleted:
              type: number
              description: The number of contacts deleted.
              example: 6
    import-contacts:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Your file is now queued.
        data:
          type: object
          properties:
            msg:
              type: string
              description: The message to display.
              example: Messages put on queue.
            ids:
              type: array
              items:
                type: string
              description: The list of ids of the imported contacts.
              example:
                - '6254358460638066203'
            id:
              type: string
              description: The list id of the imported contacts.
              example: '6254358460638066203'
paths:
  /v3/lists/{list_id}/contacts:
    get:
      summary: View List Contacts
      operationId: view-list-contacts
      description: >-
        _Get all contacts in a list_


        ### parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | list_id | path | integer(int32) | true | Contact list ID |

        | page | query | integer(int32) | false | [Page number](/#pagination) |

        | limit | query | integer(int32) | false | [Number of records per
        page](/#pagination) |

        | updated_after | query | integer(int32) | false | Get all contacts
        updated after a given timestamp. |



        Refer to [Status

        Codes](/#status-codes) for

        definitions of HTTP status code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: list_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-list-contacts'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

            'https://rest.clicksend.com/v3/lists/{list_id}/contacts'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\ContactApi(new
            GuzzleHttp\Client(),$config);

            $list_id = 185161; // int | Contact list ID

            $page = 1; // int | Page number

            $limit = 10; // int | Number of records per page


            try {
                $result = $apiInstance->listsContactsByListIdGet($list_id, $page, $limit);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling ContactApi->listsContactsByListIdGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: |-
            using IO.ClickSend.ClickSend.Api;
            using IO.ClickSend.Client;

            var configuration = new Configuration()
            {
                Username = USERNAME, 
                Password = API_KEY  
            };
            var contactApi = new ContactApi(configuration);
            var response = contactApi.ListsContactsByListIdGet(LIST_ID);
        - lang: Java
          source: |
            package ClickSend;

            import ClickSend.Api.ContactApi;

            public class view_list_contacts {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                ContactApi apiInstance = new ContactApi(defaultClient);
                Integer listId = 185161; // Integer | Contact list ID
                Integer page = 1; // Integer | Page number
                Integer limit = 10; // Integer | Number of records per page
                try {
                    String result = apiInstance.listsContactsByListIdGet(listId, page, limit);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling ContactApi#listsContactsByListIdGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var contactApi = new api.ContactApi("USERNAME", "API_KEY");


            var listId = 185161;

            var page = 1;

            var limit = 10;


            contactApi.listsContactsByListIdGet(listId, page,
            limit).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::ContactApi.new

            list_id = 56 # Integer | Contact list ID

            opts = {
              page: 1,  # Integer | Page number
              limit: 10 # Integer | Number of records per page
            }

            begin
              # Get all contacts in a list
              result = api_instance.lists_contacts_by_list_id_get(list_id, opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling ContactApi->lists_contacts_by_list_id_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.ContactApi(clicksend_client.ApiClient(configuration))

            list_id = 185161 # int | Contact list ID

            page = 1 # int | Page number (optional) (default to 1)

            limit = 10 # int | Number of records per page (optional) (default to
            10)


            try:
                # Get all contacts in a list
                api_response = api_instance.lists_contacts_by_list_id_get(list_id, page=page, limit=limit)
                print(api_response)
            except ApiException as e:
                print("Exception when calling ContactApi->lists_contacts_by_list_id_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::ContactApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::ContactApi->new(username =>
            $username, password => $password);


            my $json_output = $api->lists_contacts_by_list_id_get('list_id' =>
            '1234', page => '1', limit => '1');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSContactApi.h"

            #import "CSDefaultConfiguration.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            // Configure HTTP basic authorization (authentication scheme:
            BasicAuth)

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *listId = [NSNumber numberWithInt:11];

            NSNumber *page = [NSNumber numberWithInt:1];

            NSNumber *limit = [NSNumber numberWithInt:15];


            CSContactApi *contactApi = [[CSContactApi alloc] init];

            [contactApi listsContactsByListIdGetWithListId:listId page:page
            limit:limit completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            ContactAPI.listsContactsByListIdGet(listId: 1) { (dataString, error)
            in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }

                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
    post:
      summary: Create New Contact
      operationId: create-new-contact
      description: >-
        _Create new contact_


        ### parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | list_id | path | integer(int32) | true | List id |

        | page | query | integer(int32) | false | [Page number](/#pagination) |

        | limit | query | integer(int32) | false | [Number of records per
        page](/#pagination) |



        ### Properties


        | Name | Type | Required | Restrictions | Description |

        | --- | --- | --- | --- | --- |

        | phone_number | string | true | none | Your phone number
        in\_[E.164](https://en.wikipedia.org/wiki/E.164)\_format. Must be
        provided if no fax number or email. |

        | email | string | false | none | Your email. Must be provided if no
        phone number or fax number. |

        | fax_number | string | false | none | Your fax number. Must be provided
        if no phone number or email. |

        | first_name | string | false | none | Your first name. |

        | address_line_1 | string | false | none | Your street address |

        | address_line_2 | string | false | none | none |

        | address_city | string | false | none | Your nearest city |

        | address_state | string | false | none | Your current state |

        | address_postal_code | string | false | none | Your current postcode |

        | address_country | string | false | none | Your current country |

        | organization_name | string | false | none | Your organisation name |

        | custom_1 | string | true | none | none |

        | custom_2 | string | false | none | none |

        | custom_3 | string | false | none | none |

        | custom_4 | string | false | none | none |

        | last_name | string | false | none | Your last name |



        Refer to [Status

        Codes](/#status-codes) for

        definitions of HTTP status code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                phone_number:
                  type: string
                first_name:
                  type: string
                last_name:
                  type: string
                custom_1:
                  type: string
                custom_2:
                  type: string
                custom_3:
                  type: string
                custom_4:
                  type: string
                date_added:
                  type: string
                  nullable: true
                fax_number:
                  type: string
                  nullable: true
                organization_name:
                  type: string
                  nullable: true
                email:
                  type: string
                  nullable: true
                address_line_1:
                  type: string
                  nullable: true
                address_line_2:
                  type: string
                  nullable: true
                address_city:
                  type: string
                  nullable: true
                address_state:
                  type: string
                  nullable: true
                address_postal_code:
                  type: string
                  nullable: true
                address_country:
                  type: string
                  nullable: true
              example:
                phone_number: '3724763278'
                first_name: test
                last_name: test
                custom_1: t
                custom_2: e
                custom_3: s
                custom_4: t
                date_added: null
                fax_number: null
                organization_name: null
                email: null
                address_line_1: x
                address_line_2: null
                address_city: null
                address_state: null
                address_postal_code: null
                address_country: AU
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: list_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/create-new-contact'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request POST \
                 --header "Content-Type: application/json" \

                 --data-binary "    {
                    \"phone_number\":\"+16783270696\",
                    \"first_name\":\"Ellen\",
                    \"last_name\":\"Diaz\",
                    \"custom_1\":\"Custom 1\",
                    \"custom_2\":\"Custom 2\",
                    \"custom_3\":\"Custom 3\",
                    \"custom_4\":\"Custom 4\",
                    \"fax_number\":\"+16783270696\",
                    \"organization_name\":\"Awesome Organization\",
                    \"email\":\"ellen@diaz.com\",
                    \"address_line_1\":\"Block 2\",
                    \"address_line_2\":\"Cool Bldg.\",
                    \"address_city\":\"Nevada\",
                    \"address_state\":\"Las Vegas\",
                    \"address_postal_code\":\"36063\",
                    \"address_country\":\"US\"
                }" \
            'https://rest.clicksend.com/v3/lists/{list_id}/contacts'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\ContactApi(new
            GuzzleHttp\Client(),$config);

            $contact = new \ClickSend\Model\Contact(); //
            \ClickSend\Model\Contact | Contact model

            $contact->setPhoneNumber("+919876543210");

            $contact->setFirstName("Ellen");

            $contact->setLastName("Diaz");

            $contact->setCustom1("Custom 1");

            $contact->setCustom2("Custom 2");

            $contact->setCustom3("Custom 3");

            $contact->setCustom4("Custom 4");

            $contact->setFaxNumber("+16783270696");

            $contact->setOrganizationName("Awesome Organization");

            $contact->setEmail("ellen@diaz.com");

            $contact->setAddressLine1("Block 2");

            $contact->setAddressLine2("Cool Bldg");

            $contact->setAddressCity("Nevada");

            $contact->setAddressState("Las Vegas");

            $contact->setAddressPostalCode("36063");

            $contact->setAddressCountry("US");


            $list_id = 185161; // int | List id


            try {
                $result = $apiInstance->listsContactsByListIdPost($contact, $list_id);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling ContactApi->listsContactsByListIdPost: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var contactApi = new ContactApi(configuration);

            var contact = new Contact(
                phoneNumber: "+11231231234",
                email: "contact@email.com",
                faxNumber: "FAX_NUMBER",
                firstName: "John",
                lastName: "Doe",
                addressLine1: "Address Line 1",
                addressLine2: "Address Line 2",
                addressCity: "City",
                addressState: "State",
                addressPostalCode: "Postal Code",
                addressCountry: "CA",
                organizationName: "My COMPANY",
                custom1: "Custom 1",
                custom2: "Custom 2",
                custom3: "Custom 3",
                custom4: "Custom 4"
            );

            var response = contactApi.ListsContactsByListIdPost(contact,
            LIST_ID);
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.ContactApi;
            import ClickSend.Model.Contact;

            public class create_new_contact {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                ContactApi apiInstance = new ContactApi(defaultClient);
                Contact contact = new Contact(); // Contact | Contact model
                contact.phoneNumber("+16783270696");
                contact.custom1("custom1");
                contact.email("ellen@diaz.com");
                contact.faxNumber("+16783270696");
                contact.firstName("Ellen");
                contact.addressLine1("Block 2");
                contact.addressLine2("Cool Bldg.");
                contact.addressCity("Nevada");
                contact.addressState("Las Vegas");
                contact.addressPostalCode("36063");
                contact.addressCountry("US");
                contact.organizationName("Awesome Organization");
                contact.custom2("custom2");
                contact.custom3("custom3");
                contact.custom4("custom4");
                contact.lastName("Diaz");
                Integer listId = 185161; // Integer | List id
                try {
                  String result = apiInstance.listsContactsByListIdPost(contact, listId);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling ContactApi#listsContactsByListIdPost");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var contactApi = new api.ContactApi("USERNAME", "API_KEY");


            var contact = new api.Contact();


            contact.phoneNumber = "xxx-xxx-xxxx";

            contact.custom1 = "custom1";

            contact.email = "xxx@gmail.com";

            contact.faxNumber = "+16783270696";

            contact.firstName = "firstName";

            contact.addressLine1 = "addressLine1";

            contact.addressLine2 = "addressLine2";

            contact.addressCity = "addressCity";

            contact.addressState = "addressState";

            contact.addressPostalCode = "addressPostalCode";

            contact.addressCountry = "country";

            contact.organizationName = "organizationName";

            contact.custom2 = "custom2";

            contact.custom3 = "custom3";

            contact.custom4 = "custom4";

            contact.lastname = "lastname";


            var listId = 185161;


            contactApi.listsContactsByListIdPost(contact,
            listId).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::ContactApi.new

            # Contact | Contact model
            contact = ClickSendClient::Contact.new(
              "custom_1": "custom_1",
              "custom_3": "custom_3",
              "address_postal_code": "address_postal_code",
              "custom_2": "custom_2",
              "address_country": "US",
              "custom_4": "custom_4",
              "address_state": "address_state",
              "last_name": "last_name",
              "organization_name": "organization_name",
              "fax_number": "fax_number",
              "address_city": "address_city",
              "address_line_1": "address_line_1",
              "phone_number": "phone_number",
              "address_line_2": "address_line_2",
              "first_name": "first_name",
              "email": "email"
            )

            list_id = 56 # Integer | List id

            opts = {
              page: 1,  # Integer | Page number
              limit: 10 # Integer | Number of records per page
            }

            begin
              # Create new contact
              result = api_instance.lists_contacts_by_list_id_post(contact, list_id, opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling ContactApi->lists_contacts_by_list_id_post: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.ContactApi(clicksend_client.ApiClient(configuration))

            contact = clicksend_client.Contact(
                      phone_number="+16783270696",
                      first_name="Ellen",
                      last_name="Diaz",
                      custom_1="Custom 1",
                      custom_2="Custom 2",
                      custom_3="Custom 3",
                      custom_4="Custom 4",
                      fax_number="+16783270696",
                      organization_name="Awesome Organization",
                      email="ellen@diaz.com",
                      address_line_1="Block 2",
                      address_line_2="Cool Bldg.",
                      address_city="Nevada",
                      address_state="Las Vegas",
                      address_postal_code="36063",
                      address_country="US") # Contact | Contact model
            list_id = 185161 # int | List id

            page = 1 # int | Page number (optional) (default to 1)

            limit = 10 # int | Number of records per page (optional) (default to
            10)


            try:
                # Create new contact
                api_response = api_instance.lists_contacts_by_list_id_post(contact, list_id, page=page, limit=limit)
                print(api_response)
            except ApiException as e:
                print("Exception when calling ContactApi->lists_contacts_by_list_id_post: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::ContactApi;

            use WWW::ClickSendClient::Object::Contact;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::ContactApi->new(username =>
            $username, password => $password);


            my %params = (
                'phone_number'        => '+14055555666',
                'custom_1'            => 'custom_1',
                'email'               => 'test1@test.com',
                'fax_number'          => '+61261111111',
                'first_name'          => 'first_name',
                'address_line_1'      => 'address_line_1',
                'address_line_2'      => 'address_line_2',
                'address_city'        => 'address_city',
                'address_state'       => 'address_state',
                'address_postal_code' => 'address_postal_code',
                'address_country'     => 'US',
                'organization_name'   => 'organization_name',
                'custom_2'            => 'custom_2',
                'custom_3'            => 'custom_3',
                'custom_4'            => 'custom_4',
                'last_name'           => 'last_name'
            );


            my $contact_obj =
            WWW::ClickSendClient::Object::Contact->new(%params);


            my $json_output = $api->lists_contacts_by_list_id_post('contact' =>
            $contact_obj, 'list_id' => '1234');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSContactApi.h"

            #import "CSDefaultConfiguration.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            // Configure HTTP basic authorization (authentication scheme:
            BasicAuth)

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *listId = [NSNumber numberWithInt:11];

            CSContact *contact = [[CSContact alloc] init];

            contact.custom1 = @"custom 1";

            contact.custom2 = @"custom 2";

            contact.custom3 = @"custom 3";

            contact.custom4 = @"custom 4";

            contact.addressPostalCode = @"address_postal_code";

            contact.addressCountry = @"address_country";

            contact.addressState = @"address_state";

            contact.lastName = @"Doe";

            contact.firstName = @"John";

            contact.organizationName = @"organization_name";

            contact.faxNumber = @"fax_number";

            contact.addressLine1 = @"address_line1";

            contact.addressLine2 = @"address_line2";

            contact.phoneNumber = @"phone_numner";

            contact.email = @"email";


            CSContactApi *contactApi = [[CSContactApi alloc] init];

            [contactApi listsContactsByListIdPostWithContact:contact
            listId:listId completionHandler:^(NSString *output, NSError *error)
            {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            let contact = Contact(
                            phoneNumber: "phone_number", 
                            custom1: "custom_1", 
                            email: "johndoe@gmail.com", 
                            faxNumber: "fax_number", 
                            firstName: "John", 
                            addressLine1: "address_line1", 
                            addressLine2: "address_line2", 
                            addressCity: "city", 
                            addressState: "state", 
                            addressPostalCode: "postal_code", 
                            addressCountry: "country", 
                            organizationName: "org_name", 
                            custom2: "custom_2", 
                            custom3: "custom_3", 
                            custom4: "custom_4", 
                            lastName: "Doe"
                        )
            ContactAPI.listsContactsByListIdPost(contact: contact, listId: 11) {
            (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }

                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/lists/{from_list_id}/contacts/{contact_id}/copy/{to_list_id}:
    put:
      summary: Copy Contact to List
      operationId: copy-contact-to-list
      description: >-
        _Copy contact to another list_


        Copy contact to another list


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | from_list_id | path | integer(int32) | true | List ID for list that
        contains contact. |

        | contact_id | path | integer(int32) | true | Contact ID |

        | to_list_id | path | integer(int32) | true | List ID for list you want
        to copy contact to. |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example: ''
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: from_list_id
          in: path
          schema:
            type: string
          required: true
        - name: contact_id
          in: path
          schema:
            type: string
          required: true
        - name: to_list_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/copy-contact-to-list'
      x-codeSamples:
        - lang: curl
          source: >-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request PUT \
            'https://rest.clicksend.com/v3/lists/{from_list_id}/contacts/{contact_id}/copy/{to_list_id}'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\ContactApi(new
            GuzzleHttp\Client(),$config);

            $from_list_id = 185161; // int | List ID for list that contains
            contact.

            $contact_id = 57775238; // int | Contact ID

            $to_list_id = 204805; // int | List ID for list you want to copy
            contact to.


            try {
                $result = $apiInstance->listsCopyContactPut($from_list_id, $contact_id, $to_list_id);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling ContactApi->listsCopyContactPut: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var contactApi = new ContactApi(configuration);

            var response = contactApi.ListsCopyContactPut(FROM_LIST_ID,
            CONTACT_ID, TO_LIST_ID);
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.ContactApi;

            public class copy_contact_to_list {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                ContactApi apiInstance = new ContactApi(defaultClient);
                Integer fromListId = 185161; // Integer | List ID for list that contains contact.
                Integer contactId = 53394157; // Integer | Contact ID
                Integer toListId = 192668; // Integer | List ID for list you want to copy contact to.
                try {
                    String result = apiInstance.listsCopyContactPut(fromListId, contactId, toListId);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling ContactApi#listsCopyContactPut");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var contactApi = new api.ContactApi("USERNAME", "API_KEY");


            var fromListId = 185161;

            var contactId = 56049576;

            var toListId = 204805;


            contactApi.listsCopyContactPut(fromListId, contactId,
            toListId).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: >-
            # load the gem

            require 'clicksend_client'

            require 'json'


            # setup authorization

            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end


            api_instance = ClickSendClient::ContactApi.new


            from_list_id = 812418 # Integer | List ID for list that contains
            contact.


            contact_id = 52817364 # Integer | Contact ID


            to_list_id = 418208   # Integer | List ID for list you want to copy
            contact to.


            begin
              # Copy contact to another list
              result = api_instance.lists_copy_contact_put(from_list_id, contact_id, to_list_id)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling ContactApi->lists_copy_contact_put: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.ContactApi(clicksend_client.ApiClient(configuration))

            from_list_id = 185161 # int | List ID for list that contains
            contact.

            contact_id = 53207376 # int | Contact ID

            to_list_id = 192668 # int | List ID for list you want to copy
            contact to.


            try:
                # Copy contact to another list
                api_response = api_instance.lists_copy_contact_put(from_list_id, contact_id, to_list_id)
                print(api_response)
            except ApiException as e:
                print("Exception when calling ContactApi->lists_copy_contact_put: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::ContactApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::ContactApi->new(username =>
            $username, password => $password);


            my $json_output = api->lists_copy_contact_put('from_list_id' =>
            '1234', 'contact_id' => '123',to_list_id => '1236');


            print $json_output;
        - lang: objc
          source: >-
            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *fromListId = [[NSNumber alloc] initWithInt:1];

            NSNumber *contactId = [[NSNumber alloc] initWithInt:1];

            NSNumber *toListId = [[NSNumber alloc] initWithInt:1];


            CSContactApi *contactApiInstance = [[CSContactApi alloc] init];

            [contactApiInstance listsCopyContactPutWithFromListId:fromListId
            contactId:contactId toListId:toListId completionHandler:^(NSString
            *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            ContactAPI.listsCopyContactPut(fromListId: 1, contactId: 1,
            toListId: 1) { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            ContactAPI.listsCopyContactPut(fromListId: 1, contactId: 1,
            toListId: 1) { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/lists/{from_list_id}/contacts/{contact_id}/transfer/{to_list_id}:
    put:
      summary: Transfer Contact to List
      operationId: transfer-contact-to-list
      description: >-
        _Transfer contact to another list_


        Transfer contact to another list


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | from_list_id | path | integer(int32) | true | List ID for list that
        contains contact. |

        | contact_id | path | integer(int32) | true | Contact ID |

        | to_list_id | path | integer(int32) | true | List ID for list you want
        to transfer contact to. |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example: ''
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: from_list_id
          in: path
          schema:
            type: string
          required: true
        - name: contact_id
          in: path
          schema:
            type: string
          required: true
        - name: to_list_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/transfer-contact-to-list'
      x-codeSamples:
        - lang: curl
          source: >-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request PUT \
            'https://rest.clicksend.com/v3/lists/{from_list_id}/contacts/{contact_id}/transfer/{to_list_id}'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\ContactApi(new
            GuzzleHttp\Client(),$config);

            $from_list_id = 185161; // int | List ID for list that contains
            contact.

            $contact_id = 57775238; // int | Contact ID

            $to_list_id = 204805; // int | List ID for list you want to transfer
            contact to.


            try {
                $result = $apiInstance->listsTransferContactPut($from_list_id, $contact_id, $to_list_id);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling ContactApi->listsTransferContactPut: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var contactApi = new ContactApi(configuration);

            var response = contactApi.ListsTransferContactPut(FROM_LIST_ID,
            CONTACT_ID, TO_LIST_ID);
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.ContactApi;

            public class transfer_contact_to_list {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                ContactApi apiInstance = new ContactApi(defaultClient);
                Integer fromListId = 185161; // Integer | List ID for list that contains contact.
                Integer contactId = 53394157; // Integer | Contact ID
                Integer toListId = 192668; // Integer | List ID for list you want to transfer contact to.
                try {
                    String result = apiInstance.listsTransferContactPut(fromListId, contactId, toListId);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling ContactApi#listsTransferContactPut");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var contactApi = new api.ContactApi("USERNAME", "API_KEY");


            var fromListId = 185161;

            var contactId = 56049576;

            var toListId = 204805;


            contactApi.listsTransferContactPut(fromListId, contactId,
            toListId).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: >-
            # load the gem

            require 'clicksend_client'

            require 'json'


            # setup authorization

            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end


            api_instance = ClickSendClient::ContactApi.new


            from_list_id = 812418 # Integer | List ID for list that contains
            contact.


            contact_id = 52817364 # Integer | Contact ID


            to_list_id = 418208   # Integer | List ID for list you want to
            transfer contact to.


            begin
              # Transfer contact to another list
              result = api_instance.lists_transfer_contact_put(from_list_id, contact_id, to_list_id)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling ContactApi->lists_transfer_contact_put: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.ContactApi(clicksend_client.ApiClient(configuration))

            from_list_id = 185161 # int | List ID for list that contains
            contact.

            contact_id = 53207376 # int | Contact ID

            to_list_id = 192668 # int | List ID for list you want to transfer
            contact to.


            try:
                # Transfer contact to another list
                api_response = api_instance.lists_transfer_contact_put(from_list_id, contact_id, to_list_id)
                print(api_response)
            except ApiException as e:
                print("Exception when calling ContactApi->lists_transfer_contact_put: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::ContactApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::ContactApi->new(username =>
            $username, password => $password);


            my $json_output = api->lists_transfer_contact_put('from_list_id' =>
            '1234', 'contact_id' => '123',to_list_id => '1236');


            print $json_output;
        - lang: objc
          source: >-
            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *fromListId = [[NSNumber alloc] initWithInt:1];

            NSNumber *contactId = [[NSNumber alloc] initWithInt:1];

            NSNumber *toListId = [[NSNumber alloc] initWithInt:1];


            CSContactApi *contactApiInstance = [[CSContactApi alloc] init];

            [contactApiInstance listsTransferContactPutWithFromListId:fromListId
            contactId:contactId toListId:toListId completionHandler:^(NSString
            *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            ContactAPI.listsTransferContactPut(fromListId: 1, contactId: 1,
            toListId: 1) { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/lists/{list_id}/remove-opted-out-contacts/{opt_out_list_id}:
    put:
      summary: Remove Opted Out Contacts
      operationId: remove-opted-out-contacts
      description: >-
        _Remove all opted out contacts_


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | list_id | path | integer(int32) | true | Your list id |

        | opt_out_list_id | path | integer(int32) | true | Your opt out list id
        |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example: ''
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: list_id
          in: path
          schema:
            type: string
          required: true
        - name: opt_out_list_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/remove-opted-out-contacts'
      x-codeSamples:
        - lang: curl
          source: >-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request PUT \

            'https://rest.clicksend.com/v3/lists/{list_id}/remove-opted-out-contacts/{opt_out_list_id}'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\ContactApi(new
            GuzzleHttp\Client(),$config);

            $list_id = 201745; // int | Your list id

            $opt_out_list_id = 185161; // int | Your opt out list id


            try {
                $result = $apiInstance->listsRemoveOptedOutContactsByListIdAndOptOutListIdPut($list_id, $opt_out_list_id);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling ContactApi->listsRemoveOptedOutContactsByListIdAndOptOutListIdPut: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var contactApi = new ContactApi(configuration);

            var response =
            contactApi.ListsRemoveOptedOutContactsByListIdAndOptOutListIdPut(LIST_ID,OPT_OUT_LIST_ID);
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.ContactApi;

            public class remove_opted_contact {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                ContactApi apiInstance = new ContactApi(defaultClient);
                Integer listId = 185161; // Integer | Your list id
                Integer optOutListId = 192668; // Integer | Your opt out list id
                try {
                    String result = apiInstance.listsRemoveOptedOutContactsByListIdAndOptOutListIdPut(listId, optOutListId);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling ContactApi#listsRemoveOptedOutContactsByListIdAndOptOutListIdPut");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var contactApi = new api.ContactApi("USERNAME", "API_KEY");


            var listId = 196826;

            var optOutListId = 185161;


            contactApi.listsRemoveOptedOutContactsByListIdAndOptOutListIdPut(listId,
            optOutListId).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::ContactApi.new

            list_id = 56 # Integer | Your list id

            opt_out_list_id = 55 # Integer | Your opt out list id

            begin
              # Remove all opted out contacts
              result = api_instance.lists_remove_opted_out_contacts_by_list_id_and_opt_out_list_id_put(list_id, opt_out_list_id)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling ContactApi->lists_remove_opted_out_contacts_by_list_id_and_opt_out_list_id_put: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.ContactApi(clicksend_client.ApiClient(configuration))

            list_id = 185161 # int | Your list id

            opt_out_list_id = 185162 # int | Your opt out list id


            try:
                # Remove all opted out contacts
                api_response = api_instance.lists_remove_opted_out_contacts_by_list_id_and_opt_out_list_id_put(list_id, opt_out_list_id)
                print(api_response)
            except ApiException as e:
                print("Exception when calling ContactApi->lists_remove_opted_out_contacts_by_list_id_and_opt_out_list_id_put: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::ContactApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::ContactApi->new(username =>
            $username, password => $password);


            my $json_output =
            api->lists_remove_opted_out_contacts_by_list_id_and_opt_out_list_id_put('list_id'
            => '1234', 'opt_out_list_id' => '123');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSContactApi.h"

            #import "CSDefaultConfiguration.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            // Configure HTTP basic authorization (authentication scheme:
            BasicAuth)

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];



            NSNumber *listId = [NSNumber numberWithInt:11];

            NSNumber *optOutListId = [NSNumber numberWithInt:1];


            CSContactApi *contactApi = [[CSContactApi alloc] init];

            [contactApi
            listsRemoveOptedOutContactsByListIdAndOptOutListIdPutWithListId:listId
            optOutListId:optOutListId completionHandler:^(NSString *output,
            NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire

            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            ContactAPI.listsRemoveOptedOutContactsByListIdAndOptOutListIdPut(listId:
            1, optOutListId: 11) { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }

                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/lists:
    get:
      summary: View Lists
      operationId: view-lists
      description: >-
        _Get all contact lists_


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | page | query | integer(int32) | false | [Page number](/#pagination) |

        | limit | query | integer(int32) | false | [Number of records per
        page](/#pagination) |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-lists'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

            'https://rest.clicksend.com/v3/lists'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\ContactListApi(new
            GuzzleHttp\Client(),$config);

            $page = 1; // int | Page number

            $limit = 10; // int | Number of records per page


            try {
                $result = $apiInstance->listsGet($page, $limit);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling ContactListApi->listsGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: |-
            using IO.ClickSend.ClickSend.Api;
            using IO.ClickSend.Client;
            using IO.ClickSend.ClickSend.Model;

            var configuration = new Configuration()
            {
                Username = USERNAME, 
                Password = API_KEY  
            };
            var contactListApi = new ContactListApi(configuration);
            var response = contactListApi.ListsGet();
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.ContactListApi;

            public class view_lists {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                ContactListApi apiInstance = new ContactListApi(defaultClient);
                Integer page = 1; // Integer | Page number
                Integer limit = 10; // Integer | Number of records per page
                try {
                    String result = apiInstance.listsGet(page, limit);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling ContactListApi#listsGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: |-
            var api = require('./api.js');

            var contactListApi = new api.ContactListApi("USERNAME", "API_KEY");

            var page = 1;
            var limit = 10;

            contactListApi.listsGet(page, limit).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::ContactListApi.new

            opts = {
              page: 1,  # Integer | Page number
              limit: 10 # Integer | Number of records per page
            }

            begin
              # Get all contact lists
              result = api_instance.lists_get(opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling ContactListApi->lists_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.ContactListApi(clicksend_client.ApiClient(configuration))

            page = 1 # int | Page number (optional) (default to 1)

            limit = 10 # int | Number of records per page (optional) (default to
            10)


            try:
                # Get all contact lists
                api_response = api_instance.lists_get(page=page, limit=limit)
                print(api_response)
            except ApiException as e:
                print("Exception when calling ContactListApi->lists_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::ContactListApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::ContactListApi->new(username =>
            $username, password => $password);


            my $json_output = $api->lists_get('page' => '1', 'limit' => '10');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSContactListApi.h"

            #import "CSDefaultConfiguration.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *page = [[NSNumber alloc] initWithInt:1];

            NSNumber *limit = [[NSNumber alloc] initWithInt:1];


            CSContactListApi *contactListApiInstance = [[CSContactListApi alloc]
            init];

            [contactListApiInstance listsGetWithPage:page limit:limit
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            ContactListAPI.listsGet(page: 1, limit: 15) { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
    post:
      summary: Create List
      operationId: create-list
      description: >-
        _Create new contact list_


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | list_name | body | string | true | Your contact list name |


        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.


        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                list_name:
                  type: string
              example:
                list_name: test
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/create-list'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request POST \
                 --header "Content-Type: application/json" \

                 --data-binary "    {
                    \"list_name\":\"ListCT3QrVL4od\"
                }" \
            'https://rest.clicksend.com/v3/lists'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\ContactListApi(new
            GuzzleHttp\Client(),$config);

            $contact_list = new \ClickSend\Model\ContactList(); //
            \ClickSend\Model\ContactList | Contact list model

            $contact_list->setListName("new contact list");


            try {
                $result = $apiInstance->listsPost($contact_list);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling ContactListApi->listsPost: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var contactListApi = new ContactListApi(configuration);

            var response = contactListApi.ListsPost(new List() { ListName =
            "Name" });
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.ContactListApi;
            import ClickSend.Model.ContactList;

            public class create_list {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                ContactListApi apiInstance = new ContactListApi(defaultClient);
                ContactList contactList = new ContactList(); // ContactList | Contact list model
                contactList.listName("new_list");
                try {
                    String result = apiInstance.listsPost(contactList);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling ContactListApi#listsPost");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: |-
            var api = require('./api.js');

            var contactListApi = new api.ContactListApi("USERNAME", "API_KEY");

            var contactList = new api.ContactList();

            contactList.listName = "list_name";

            contactListApi.listsPost(contactList).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::ContactListApi.new

            # List | List model
            list = ClickSendClient::List.new("list_name": "ListCT3QrVL4od")

            begin
              # Create new contact list
              result = api_instance.lists_post(list)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling ContactListApi->lists_post: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.ContactListApi(clicksend_client.ApiClient(configuration))

            list = clicksend_client.List(list_name="new list") # List | List
            model


            try:
                # Create new contact list
                api_response = api_instance.lists_post(list)
                print(api_response)
            except ApiException as e:
                print("Exception when calling ContactListApi->lists_post: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::ContactListApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::ContactListApi->new(username =>
            $username, password => $password);


            my $json_output = $api->lists_post('list_name' => 'test_list');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSContactListApi.h"

            #import "CSDefaultConfiguration.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            // Configure HTTP basic authorization (authentication scheme:
            BasicAuth)

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];



            CSContactList *contactList = [[CSContactList alloc] init];

            contactList.listName = @"list_name";


            CSContactListApi *contactListApi = [[CSContactListApi alloc] init];

            [contactListApi listsPostWithContactList:contactList
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            let contactList = ContactList(listName: "list_name")

            ContactListAPI.listsPost(contactList: contactList) { (dataString,
            error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }

                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/lists/{list_id}:
    get:
      summary: View Secific List
      operationId: view-specific-list
      description: >-
        _Get specific contact list_


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | list_id | path | integer(int32) | true | List ID |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: list_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-specific-list'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

            'https://rest.clicksend.com/v3/lists/{list_id}'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\ContactListApi(new
            GuzzleHttp\Client(),$config);

            $list_id = 185161; // int | List ID


            try {
                $result = $apiInstance->listsByListIdGet($list_id);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling ContactListApi->listsByListIdGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: |-
            using IO.ClickSend.ClickSend.Api;
            using IO.ClickSend.Client;
            using IO.ClickSend.ClickSend.Model;

            var configuration = new Configuration()
            {
                Username = USERNAME, 
                Password = API_KEY  
            };
            var contactListApi = new ContactListApi(configuration);
            var response = contactListApi.ListsByListIdGet(LIST_ID);
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.ContactListApi;

            public class view_specific_list {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                ContactListApi apiInstance = new ContactListApi(defaultClient);
                Integer listId = 185161; // Integer | List ID
                try {
                    String result = apiInstance.listsByListIdGet(listId);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling ContactListApi#listsByListIdGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: |-
            var api = require('./api.js');

            var contactListApi = new api.ContactListApi("USERNAME", "API_KEY");

            var listId = 185161;

            contactListApi.listsByListIdGet(listId).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::ContactListApi.new

            list_id = 56 # Integer | List ID

            begin
              # Get specific contact list
              result = api_instance.lists_by_list_id_get(list_id)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling ContactListApi->lists_by_list_id_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.ContactListApi(clicksend_client.ApiClient(configuration))

            list_id = 185160 # int | List ID


            try:
                # Get specific contact list
                api_response = api_instance.lists_by_list_id_get(list_id)
                print(api_response)
            except ApiException as e:
                print("Exception when calling ContactListApi->lists_by_list_id_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::ContactListApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::ContactListApi->new(username =>
            $username, password => $password);


            my $json_output = $api->lists_by_list_id_get('list_id' => '12345');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSContactListApi.h"

            #import "CSDefaultConfiguration.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            // Configure HTTP basic authorization (authentication scheme:
            BasicAuth)

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *listId = [NSNumber numberWithInt:1];

            CSContactListApi *contactListApi = [[CSContactListApi alloc] init];


            [contactListApi listsByListIdGetWithListId:listId
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire

            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            ContactListAPI.listsByListIdGet(listId: 1) { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }

                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
    put:
      summary: Update List
      operationId: update-list
      description: >-
        _Update specific contact list_


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | list_id | path | integer(int32) | true | Your list id |

        | list_name | body | string | true | Your new list name |


        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.


        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                list_name:
                  type: string
              example:
                list_name: test
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: list_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-list'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request PUT \
                 --header "Content-Type: application/json" \

                 --data-binary "    {
                    \"list_name\":\"ListlPJf33ksjP\"
                }" \
            'https://rest.clicksend.com/v3/lists/{list_id}'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\ContactListApi(new
            GuzzleHttp\Client(),$config);

            $list_id = 185161; // int | Your list id

            $contact_list = new \ClickSend\Model\ContactList(); //
            \ClickSend\Model\ContactList | Contact list model

            $contact_list->setListName("new contact list");


            try {
                $result = $apiInstance->listsByListIdPut($list_id, $contact_list);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling ContactListApi->listsByListIdPut: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var contactListApi = new ContactListApi(configuration);

            var response = contactListApi.ListsByListIdPut(LIST_ID, new List() {
            ListName = "Name" });
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.ContactListApi;
            import ClickSend.Model.ContactList;

            public class update_list {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                ContactListApi apiInstance = new ContactListApi(defaultClient);
                Integer listId = 199237; // Integer | Your list id
                ContactList contactList = new ContactList(); // ContactList | Contact list model
                contactList.listName("updated_list");
                try {
                    String result = apiInstance.listsByListIdPut(listId, contactList);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling ContactListApi#listsByListIdPut");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var contactListApi = new api.ContactListApi("USERNAME", "API_KEY");


            var contactList = new api.ContactList();


            contactList.listName = "list";


            var listId = 185161;


            contactListApi.listsByListIdPut(listId,
            contactList).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::ContactListApi.new

            list_id = 56 # Integer | Your list id

            # List | List model
            list = ClickSendClient::List.new("list_name": "ListlPJf33ksjP")

            begin
              # Update specific contact list
              result = api_instance.lists_by_list_id_put(list_id, list)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling ContactListApi->lists_by_list_id_put: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.ContactListApi(clicksend_client.ApiClient(configuration))

            list_id = 185160 # int | Your list id

            list_name = 'updated_list' # str | Your new list name


            try:
                # Update specific contact list
                api_response = api_instance.lists_by_list_id_put(list_id, list_name)
                print(api_response)
            except ApiException as e:
                print("Exception when calling ContactListApi->lists_by_list_id_put: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::ContactListApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::ContactListApi->new(username =>
            $username, password => $password);


            my $json_output = $api->lists_by_list_id_put('list_id' => '12345',
            'list_name' => 'test list name');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSContactListApi.h"

            #import "CSDefaultConfiguration.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            // Configure HTTP basic authorization (authentication scheme:
            BasicAuth)

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *listId = [NSNumber numberWithInt:1];

            CSContactList *contactList =  [[CSContactList alloc] init];

            contactList.listName = @"list_name";


            CSContactListApi *contactListApi = [[CSContactListApi alloc] init];


            [contactListApi listsByListIdPutWithListId:listId
            contactList:contactList completionHandler:^(NSString *output,
            NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire

            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            let contactList = ContactList(listName: "list_name")

            ContactListAPI.listsByListIdPut(listId: 1, contactList: contactList)
            { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }

                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
    delete:
      summary: Delete List
      operationId: delete-list
      description: >-
        _ListsByListIdDelete_


        Delete a specific contact list


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | list_id | path | integer(int32) | true | List ID |


        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.


        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: list_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete-list'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request DELETE \

            'https://rest.clicksend.com/v3/lists/{list_id}'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\ContactListApi(new
            GuzzleHttp\Client(),$config);

            $list_id = 204805; // int | List ID


            try {
                $result = $apiInstance->listsByListIdDelete($list_id);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling ContactListApi->listsByListIdDelete: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: |-
            using IO.ClickSend.ClickSend.Api;
            using IO.ClickSend.Client;
            using IO.ClickSend.ClickSend.Model;

            var configuration = new Configuration()
            {
                Username = USERNAME, 
                Password = API_KEY  
            };
            var contactListApi = new ContactListApi(configuration);
            var response = contactListApi.ListsByListIdDelete(LIST_ID);
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.ContactListApi;

            public class delete_list {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                ContactListApi apiInstance = new ContactListApi(defaultClient);
                Integer listId = 192668; // Integer | List ID
                try {
                    String result = apiInstance.listsByListIdDelete(listId);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling ContactListApi#listsByListIdDelete");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: |-
            var api = require('./api.js');

            var contactListApi = new api.ContactListApi("USERNAME", "API_KEY");

            var listId = 196826;

            contactListApi.listsByListIdDelete(listId).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::ContactListApi.new

            list_id = 56 # Integer | List ID

            begin
              # ListsByListIdDelete
              result = api_instance.lists_by_list_id_delete(list_id)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling ContactListApi->lists_by_list_id_delete: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.ContactListApi(clicksend_client.ApiClient(configuration))

            list_id = 185160 # int | List ID


            try:
                # ListsByListIdDelete
                api_response = api_instance.lists_by_list_id_delete(list_id)
                print(api_response)
            except ApiException as e:
                print("Exception when calling ContactListApi->lists_by_list_id_delete: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::ContactListApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::ContactListApi->new(username =>
            $username, password => $password);


            my $json_output = $api->lists_by_list_id_delete('list_id' =>
            '12345');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSContactListApi.h"

            #import "CSDefaultConfiguration.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            // Configure HTTP basic authorization (authentication scheme:
            BasicAuth)

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *listId = [NSNumber numberWithInt:1];


            CSContactListApi *contactListApi = [[CSContactListApi alloc] init];


            [contactListApi listsByListIdDeleteWithListId:listId
            completionHandler:^(NSString *output, NSError *error) {

            NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire

            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            ContactListAPI.listsByListIdDelete(listId: 1) { (dataString, error)
            in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }

                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/lists/{list_id}/remove-duplicates/:
    put:
      summary: Remove Duplicate Contacts
      operationId: remove-duplicate-contacts
      description: >-
        _Remove duplicate contacts_


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | list_id | path | integer(int32) | true | Your list id |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                fields:
                  type: object
                  properties:
                    first_name:
                      type: string
                    last_name:
                      type: string
              example:
                fields:
                  first_name: first_name
                  last_name: last_name
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: list_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/remove-duplicate-contacts'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request PUT \

                 --header "Content-Type: application/json" \
                 --data-binary "{
                \"fields\":[
                    \"phone_number\",
                    \"first_name\",
                    \"last_name\",
                    \"fax_number\",
                    \"address_country\"
                ]
            }" \
            'https://rest.clicksend.com/v3/lists/{list_id}/remove-duplicates'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\ContactListApi(new
            GuzzleHttp\Client(),$config);

            $list_id = 185161; // int | Your list id

            $field= new \ClickSend\Model\FieldsFields();

            $field->setPhoneNumber("phone_number");

            $fields = new \ClickSend\Model\Fields(); // \ClickSend\Model\Fields
            | Fields model

            $fields->setFields($field);


            try {
                $result = $apiInstance->listsRemoveDuplicatesByListIdPut($list_id, $fields);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling ContactListApi->listsRemoveDuplicatesByListIdPut: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var contactListApi = new ContactListApi(configuration);

            var response =
            contactListApi.ListsRemoveDuplicatesByListIdPut(76467, new Fields(
                new FieldsFields(
                    phoneNumber: "+11231231234",
                    email: "contact@email.com",
                    faxNumber: "FAX_NUMBER",
                    firstName: "John",
                    lastName: "Doe",
                    addressLine1: "Address Line 1",
                    addressLine2: "Address Line 2",
                    addressCity: "City",
                    addressState: "State",
                    addressPostalCode: "Postal Code",
                    addressCountry: "CA",
                    organizationName: "My COMPANY",
                    custom1: "Custom 1",
                    custom2: "Custom 2",
                    custom3: "Custom 3",
                    custom4: "Custom 4"
                ))
            );
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.ContactListApi;
            import ClickSend.Model.Fields;
            import ClickSend.Model.FieldsFields;

            public class remove_duplicate_contact {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                ContactListApi apiInstance = new ContactListApi(defaultClient);
                Integer listId = 185161; // Integer | Your list id
                FieldsFields field=new  FieldsFields();
                field.phoneNumber("phone_number");
                field.addressCity("city");
                Fields fields = new Fields(); // Fields | Fields model
                fields.fields(field);
                try {
                    String result = apiInstance.listsRemoveDuplicatesByListIdPut(listId, fields);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling ContactListApi#listsRemoveDuplicatesByListIdPut");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var contactListApi = new api.ContactListApi("USERNAME", "API_KEY");


            var listId = 185161;


            var fieldList = new api.FieldsFields();


            fieldList.phoneNumber = "phone_number";

            fieldList.city = "city";


            var fields = new api.Fields();


            fields.fields = fieldList


            contactListApi.listsRemoveDuplicatesByListIdPut(listId,
            fields).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::ContactListApi.new

            list_id = 56 # Integer | Your list id

            # Fields | Fields model
            fields = ClickSendClient::Fields.new(
              fields: ClickSendClient::FieldsFields.new(
                "phone_number": "phone_number",
                "custom_1": "custom_1",
                "email": "email",
                "fax_number": "fax_number",
                "first_name": "first_name",
                "address_line_1": "address_line_1",
                "address_line_2": "address_line_2",
                "address_city": "address_city",
                "address_state": "address_state",
                "address_postal_code": "address_postal_code",
                "address_country": "address_country",
                "organization_name": "organization_name",
                "custom_2": "custom2",
                "custom_3": "custom3",
                "custom_4": "custom4",
                "last_name": "last_name"
              )
            )

            begin
              # Remove duplicate contacts
              result = api_instance.lists_remove_duplicates_by_list_id_put(list_id, fields)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling ContactListApi->lists_remove_duplicates_by_list_id_put: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.ContactListApi(clicksend_client.ApiClient(configuration))

            list_id = 185161 # int | Your list id

            fields = clicksend_client.Fields(fields=['phone_number',
            'first_name'])

            try:
                # Remove duplicate contacts
                api_response = api_instance.lists_remove_duplicates_by_list_id_put(list_id,fields)
                print(api_response)
            except ApiException as e:
                print("Exception when calling ContactListApi->lists_remove_duplicates_by_list_id_put: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::ContactListApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::ContactListApi->new(username =>
            $username, password => $password);


            my $json_output =
              $api->lists_remove_duplicates_by_list_id_put('list_id' => '12345', 'fields' => [ 'phone_number', 'first_name' ]);

            print $json_output;
        - lang: objc
          source: >-
            #import "CSContactListApi.h"

            #import "CSDefaultConfiguration.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            // Configure HTTP basic authorization (authentication scheme:
            BasicAuth)

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *listId = [NSNumber numberWithInt:1];


            CSFieldsFields *fieldsFields = [[CSFieldsFields alloc] init];

            fieldsFields.phoneNumber = @"phone_number";

            fieldsFields.firstName = @"first_name";

            fieldsFields.lastName = @"last_name";

            fieldsFields.faxNumber = @"fax";

            fieldsFields.addressCountry = @"address_coiuntry";


            CSFields *fields = [[CSFields alloc] init];

            fields.fields = fieldsFields;


            CSContactListApi *contactListApi = [[CSContactListApi alloc] init];


            [contactListApi listsRemoveDuplicatesByListIdPutWithListId:listId
            fields:fields completionHandler:^(NSString *output, NSError *error)
            {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            let fieldsFields = FieldsFields(
                                    phoneNumber: "phone_number", 
                                    custom1: nil, 
                                    email: "email", 
                                    faxNumber: "fax_number", 
                                    firstName: "first_name", 
                                    addressLine1: "address_line1", 
                                    addressLine2: nil, 
                                    addressCity: "address_city", 
                                    addressState: "state", 
                                    addressPostalCode: "postal", 
                                    addressCountry: "cpountry", 
                                    organizationName: "organization", 
                                    custom2: nil, 
                                    custom3: nil, 
                                    custom4: nil, 
                                    lastName: "last_name"
                                )

            let fields = Fields(fields: fieldsFields)

            ContactListAPI.listsRemoveDuplicatesByListIdPut(listId: 1, fields:
            fields) { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }

                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/lists/{list_id}/import:
    post:
      summary: Import Contacts
      operationId: import-contacts
      description: >-
        _Import contacts to list_


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | list_id | path | integer(int32) | true | Your contact list id you want
        to access. |


        ### Properties


        | Name | Type | Required | Restrictions | Description |

        | --- | --- | --- | --- | --- |

        | file_url | string | true | none | URL of file to process |

        | field_order | \[string\] | true | none | Order of fields in file |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                file_url:
                  type: string
                field_order:
                  type: string
              example:
                file_url: '{{fileURL}}'
                field_order: test
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: list_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/import-contacts'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request POST \

                 --header "Content-Type: application/json" \
                 --data-binary "{
                \"file_url\":\"http://yourdomain.com/import.csv\",
                \"field_order\":[
                    \"phone\",
                    \"first_name\",
                    \"last_name\",
                    \"custom1\",
                    \"custom2\",
                    \"custom3\",
                    \"custom4\",
                    \"fax_number\",
                    \"organization_name\",
                    \"email\",
                    \"address_line_1\",
                    \"address_line_2\",
                    \"address_city\",
                    \"address_state\",
                    \"address_postal_code\",
                    \"address_country\"
                ]
            }" \
            'https://rest.clicksend.com/v3/lists/{list_id}/import'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\ContactListApi(new
            GuzzleHttp\Client(),$config);

            $list_id = 185161; // int | Your contact list id you want to access.

            $file = new \ClickSend\Model\ContactListImport(); //
            \ClickSend\Model\ContactListImport | ContactListImport model

            $file->setFileUrl("https://rest.clicksend.com//files/15A3C0E9-F6A5-49CE-907F-1AD49F75A2AE.csv");

            $file->setFieldOrder(["phone","first_name","last_name","custom1","custom2","custom3","custom4","fax_number","organization_name","email","address_line_1","address_line_2","address_city","address_state","address_postal_code","address_country"]);


            try {
                $result = $apiInstance->listsImportByListIdPost($list_id, $file);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling ContactListApi->listsImportByListIdPost: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var contactListApi = new ContactListApi(configuration);

            var fieldsOrder = new List<string>() {
                "phone",
                "first_name",
                "last_name",
                "custom1",
                "custom2",
                "custom3",
                "custom4",
                "fax_number",
                "organization_name",
                "email",
                "address_line_1",
                "address_line_2",
                "address_city",
                "address_state",
                "address_postal_code",
                "address_country"
            };

            var contactListImport = new
            ContactListImport("https://yourdomain.com/import.csv", fieldsOrder);

            var response = contactListApi.ListsImportByListIdPost(LIST_ID,
            contactListImport);
        - lang: Java
          source: |-
            package ClickSend;

            import java.util.Arrays;
            import java.util.List;

            import ClickSend.Api.ContactListApi;
            import ClickSend.Model.ContactListImport;

            public class import_contacts {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                ContactListApi apiInstance = new ContactListApi(defaultClient);
                Integer listId = 185161; // Integer | Your contact list id you want to access.
                List<String> fieldList = Arrays.asList(
                "phone", "first_name", "last_name", 
                "custom1", "custom2", "custom3", "custom4",
                "fax_number", "organization_name", "email", 
                "address_line_1", "address_line_2", "address_city",
                "address_state", "address_postal_code", "address_country");

                // ContactListImport | ContactListImport model
                ContactListImport file = new ContactListImport(); 
                file.fileUrl("https://rest.clicksend.com/files/973181E1-7D1C-4DB4-A374-8407A45CD1B7.txt");
                file.fieldOrder(fieldList);
                try {
                    String result = apiInstance.listsImportByListIdPost(listId, file);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling ContactListApi#listsImportByListIdPost");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var contactListApi = new api.ContactListApi("USERNAME", "API_KEY");


            var listId = 185161;


            var file = new api.ContactListImport();


            file.fileUrl =
            "https://rest.clicksend.com/files/6D1801BB-9E03-42B8-A69F-5A5222D95C9F.csv";

            file.fieldOrder = [
                "phone",
                "first_name",
                "last_name",
                "custom1",
                "custom2",
                "custom3",
                "custom4",
                "fax_number",
                "organization_name",
                "email",
                "address_line_1",
                "address_line_2",
                "address_city",
                "address_state",
                "address_postal_code",
                "address_country"
            ]


            contactListApi.listsImportByListIdPost(listId,
            file).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::ContactListApi.new

            list_id = 56 # Integer | Your contact list id you want to access.

            # ContactListImport | ContactListImport model
            file = ClickSendClient::ContactListImport.new(
              "file_url": "file_url",
              "field_order": %w[field_order field_order field_order]
            )

            begin
              # Import contacts to list
              result = api_instance.lists_import_by_list_id_post(list_id, file)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling ContactListApi->lists_import_by_list_id_post: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.ContactListApi(clicksend_client.ApiClient(configuration))

            list_id = 185161 # int | Your contact list id you want to access.

            field_order=["phone","first_name","last_name",

            "custom1","custom2","custom3","custom4",

            "fax_number","organization_name","email",

            "address_line_1","address_line_2","address_city",

            "address_state","address_postal_code","address_country"]


            # ContactListImport | ContactListImport model

            file =
            clicksend_client.ContactListImport(file_url="https://rest.clicksend.com/files/973181E1-7D1C-4DB4-A374-8407A45CD1B7.txt",field_order=[field_order]) 


            try:
                # Import contacts to list
                api_response = api_instance.lists_import_by_list_id_post(list_id, file)
                print(api_response)
            except ApiException as e:
                print("Exception when calling ContactListApi->lists_import_by_list_id_post: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::ContactListApi;

            use WWW::ClickSendClient::Object::ContactListImport;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::ContactListApi->new(username =>
            $username, password => $password);


            my %params = (
                'file_url'    => 'http://yourdomain.com/import.csv',
                'field_order' => [ 'phone_number', 'first_name' ]
            );


            my $contact_list_obj =
            WWW::ClickSendClient::Object::ContactListImport->new(%params);


            my $json_output = $api->lists_import_by_list_id_post('list_id' =>
            '185530', 'file' => $contact_list_obj);


            print $json_output;
        - lang: objc
          source: >-
            #import "CSContactListApi.h"

            #import "CSDefaultConfiguration.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            // Configure HTTP basic authorization (authentication scheme:
            BasicAuth)

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *listId = [NSNumber numberWithInt:1];


            CSContactListImport *contactListImport = [[CSContactListImport
            alloc] init];

            contactListImport.fileUrl = @"file_url";

            contactListImport.fieldOrder = @[@"field_order", @"field_order"];


            CSContactListApi *contactListApi = [[CSContactListApi alloc] init];


            [contactListApi listsImportByListIdPostWithListId:listId
            file:contactListImport completionHandler:^(NSString *output, NSError
            *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire

            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            let contactListImport = ContactListImport(
                                        fileUrl: "file_url", 
                                        fieldOrder: ["field_order",
                                                     "field_order"]
                                    )

            ContactListAPI.listsImportByListIdPost(listId: 1, file:
            contactListImport) { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }

                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/search/contacts-lists:
    get:
      summary: View Contact Lists
      operationId: view-contact-lists
      description: >-
        _Get list of searched contact list_


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | q | query | string | true | Your keyword or query. |

        | page | query | integer(int32) | false | [Page
        number](https://developers.clicksend.com/docs/rest/v3/#pagination) |

        | limit | query | integer(int32) | false | [Number of records per
        page](https://developers.clicksend.com/docs/rest/v3/#pagination) |


        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.


        This endpoint requires authentication, [more
        info...](https://developers.clicksend.com/docs/rest/v3/#authentication)
      security:
        - basicAuth: []
      parameters:
        - name: q
          in: query
          schema:
            type: string
          example: Test
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \

            'https://rest.clicksend.com/v3/search/contacts-lists?q={q}'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\SearchApi(new
            GuzzleHttp\Client(),$config);

            $q = "q_example"; // string | Your keyword or query.

            $page = 1; // int | Page number

            $limit = 10; // int | Number of records per page


            try {
                $result = $apiInstance->searchContactsListsGet($q, $page, $limit);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling SearchApi->searchContactsListsGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: |-
            using IO.ClickSend.ClickSend.Api;
            using IO.ClickSend.Client;
            using IO.ClickSend.ClickSend.Model;

            var configuration = new Configuration()
            {
                Username = USERNAME, 
                Password = API_KEY  
            };
            var searchApi = new SearchApi(configuration);
            var response = searchApi.SearchContactsListsGet("QUERY");
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.SearchApi;

            public class view_contact_list {
               public static void main(String[] args) {
                  ApiClient defaultClient = new ApiClient();
                  defaultClient.setUsername("USERNAME");
                  defaultClient.setPassword("API_KEY");
                  SearchApi apiInstance = new SearchApi(defaultClient);
                  String q = "q_example"; // String | Your keyword or query.
                  Integer page = 1; // Integer | Page number
                  Integer limit = 10; // Integer | Number of records per page
                  try {
                      String result = apiInstance.searchContactsListsGet(q, page, limit);
                      System.out.println(result);
                  } catch (ApiException e) {
                      System.err.println("Exception when calling SearchApi#searchContactsListsGet");
                      e.printStackTrace();
                  }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var searchApi = new api.SearchApi("USERNAME", "API_KEY");


            var q = "q_example";

            var page = 1;

            var limit = 10;


            searchApi.searchContactsListsGet(q, page,
            limit).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::SearchApi.new

            q = "q_example" # String | Your keyword or query.

            opts = {
              page: 1,  # Integer | Page number
              limit: 10 # Integer | Number of records per page
            }

            begin
              # Get list of searched contact list
              result = api_instance.search_contacts_lists_get(q, opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling SearchApi->search_contacts_lists_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.SearchApi(clicksend_client.ApiClient(configuration))

            q = 'q_example' # str | Your keyword or query.

            page = 1 # int | Page number (optional) (default to 1)

            limit = 10 # int | Number of records per page (optional) (default to
            10)


            try:
                # Get list of searched contact list
                api_response = api_instance.search_contacts_lists_get(q, page=page, limit=limit)
                print(api_response)
            except ApiException as e:
                print("Exception when calling SearchApi->search_contacts_lists_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::SearchApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::SearchApi->new(username =>
            $username, password => $password);


            my $json_output = $api->search_contacts_lists_get('page'  => 1, 'q'
            => '' ,'limit' => '');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSSearchApi.h"

            #import "CSDefaultConfiguration.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            // Configure HTTP basic authorization (authentication scheme:
            BasicAuth)

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            CSSearchApi *searchApi = [[CSSearchApi alloc] init];

            [searchApi searchContactsListsGetWithQ:@"q" page:@(1) limit:@(15)
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire

            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            SearchAPI.searchContactsListsGet(q: "q") { (dataString, error) in
                if let error = error {
                    print(error)
                } else {
                    if let data = dataString!.data(using: String.Encoding.utf8) {
                        do {
                            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                                print(dictonary)
                            } else {
                                print("Cannot convert the String value to JSON")
                            }
                        } catch let error as NSError {
                            print(error)
                        }
                    }
                }
            }
