> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wiza.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Get List Contacts

> >
Get contacts for a list.

By default a json response is returned. To get a csv response, append `.csv` to the url path.



## OpenAPI

````yaml /swagger/v1/openapi.yaml get /api/lists/{id}/contacts
openapi: 3.0.1
info:
  title: Wiza API Documentation
  version: v1
servers:
  - url: https://wiza.co
    variables:
      defaultHost:
        default: wiza.co
security: []
paths:
  /api/lists/{id}/contacts:
    parameters:
      - name: id
        in: path
        description: id
        required: true
        schema:
          type: string
    get:
      tags:
        - Lists
      summary: Get List Contacts
      description: >-
        >

        Get contacts for a list.


        By default a json response is returned. To get a csv response, append
        `.csv` to the url path.
      parameters:
        - name: segment
          in: query
          required: true
          description: |-
            >
            Specify the segment of contacts to return.
            | Segment | Description           |
            |----------|-----------------------|
            | people   | All contacts          |
            | valid    | Only valid contacts   |
            | risky    | Only risky contacts   |
          schema:
            type: string
            enum:
              - people
              - valid
              - risky
            example: people
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactsResponse'
        '400':
          description: Error getting list
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 400
                      message:
                        type: string
                        example: Segment is not valid
                        description: |
                          >
                          Potential error messages:

                          - Segment is not valid
                          - No contacts to export
        '401':
          description: Unauthorized
      security:
        - bearer_auth: []
      x-codeSamples:
        - lang: Javascript
          source: >
            const apiKey = "your api key here" // update with your api_key

            const listId = 0 // update with the id of the list that you would
            like returned


            const myHeaders = new Headers();

            myHeaders.append("Authorization", `Bearer ${apiKey}`);


            const requestOptions = {
              method: "GET",
              headers: myHeaders,
              redirect: "follow"
            };


            fetch(`https://wiza.co/api/lists/${listId}/contacts?segment=people`,
            requestOptions)
              .then((response) => response.text())
              .then((result) => console.log(result))
              .catch((error) => console.error(error));
        - lang: Python
          source: >
            import http.client


            api_key = "your api key here" # update with your api_key

            list_id = 0 # update with the id of the list that you would like
            returned


            conn = http.client.HTTPSConnection("wiza.co")

            authorization = ("Bearer {api_key}").format(api_key=api_key)

            payload = ''

            headers = { 'Authorization': authorization}

            url =
            ("/api/lists/{list_id}/contacts?segment=people").format(list_id=list_id)

            conn.request("GET", url, payload, headers)

            res = conn.getresponse()

            data = res.read()

            print(data.decode("utf-8"))
        - lang: Ruby
          source: >
            require "uri"

            require "net/http"


            api_key = "your api key here" # update with your api_key

            list_id = 0 # update with the id of the list that you would like
            returned


            url =
            URI("https://wiza.co/api/lists/#{list_id}/contacts?segment=people")


            https = Net::HTTP.new(url.host, url.port);

            https.use_ssl = true


            request = Net::HTTP::Get.new(url)

            request["Authorization"] = "Bearer #{api_key}"


            response = https.request(request)

            puts response.read_body
        - lang: Curl
          source: >
            api_key="your api key here" # update with your api_key

            list_id=0 # update with the id of the list that you would like
            returned


            curl --location
            "https://wiza.co/api/lists/${list_id}/contacts?segment=people"
            --header "Authorization: Bearer ${api_key}"
components:
  schemas:
    ContactsResponse:
      type: object
      properties:
        status:
          type: object
          properties:
            code:
              type: integer
              example: 200
            message:
              type: string
              example: ''
        data:
          type: array
          items:
            type: object
            properties:
              list_name:
                type: string
                example: from api1
              email_type:
                type: string
                nullable: true
                example: work
              email_status:
                type: string
                nullable: true
                example: risky
              email:
                type: string
                nullable: true
                example: stephen@wiza.co
              full_name:
                type: string
                nullable: true
                example: Stephen Hakami
              first_name:
                type: string
                example: Stephen
              last_name:
                type: string
                example: Hakami
              title:
                type: string
                example: Founder, Chief Executive Officer
              location:
                type: string
                example: New York / Toronto
              linkedin:
                type: string
                example: https://www.linkedin.com/in/stephen-hakami-5babb21b0/
              domain:
                type: string
                example: wiza.co
              company:
                type: string
                example: Wiza
              company_domain:
                type: string
                example: wiza.co
              company_industry:
                type: string
                nullable: true
              company_subindustry:
                type: string
                nullable: true
              company_size:
                type: string
                nullable: true
              company_size_range:
                type: string
                nullable: true
              company_founded:
                type: string
                nullable: true
              company_revenue:
                type: string
                nullable: true
              company_funding:
                type: string
                nullable: true
              company_type:
                type: string
                nullable: true
              company_linkedin:
                type: string
                example: https://www.linkedin.com/company/wizainc/
              company_twitter:
                type: string
                nullable: true
              company_facebook:
                type: string
                nullable: true
              company_description:
                type: string
                nullable: true
              company_last_funding_round:
                type: string
                nullable: true
              company_last_funding_amount:
                type: string
                nullable: true
              company_last_funding_at:
                type: string
                nullable: true
              company_location:
                type: string
                nullable: true
              company_street:
                type: string
                nullable: true
              company_locality:
                type: string
                nullable: true
              company_region:
                type: string
                nullable: true
              company_country:
                type: string
                nullable: true
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      description: >-
        Enter your bearer token (your API key) in the **Authorization** header
        in the format `Bearer {token}`

````