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

# Get Survey by Stream

> Returns the parent Survey for a Stream, including SampleExclusions and SampleExclusionsRules. The response payload matches Get Survey.

Returns the parent Survey for a Stream. The payload matches [Get Survey](https://docs.repdata.com/supply/endpoints/get-v2-surveys-SurveyNumber), including `SampleExclusions` and `SampleExclusionsRules`.

##### Path Parameters

| Parameter | Description | Required | Example |
| - | - | - | - |
| `StreamNumber` | The `StreamNumber` (integer) or `StreamUd` (UUID) of the stream. | Yes | `850` |

`SampleExclusionsRules` is also returned on [List Surveys & Streams](https://docs.repdata.com/supply/endpoints/get-v2-surveys) and [Get Survey](https://docs.repdata.com/supply/endpoints/get-v2-surveys-SurveyNumber).


## OpenAPI

````yaml GET /v2/surveys/streams/{StreamNumber}
openapi: 3.0.3
info:
  title: Research Desk Supply API
  version: 1.0.0
  description: >-
    Rep Data's sample platform, Research Desk, lets sample suppliers integrate
    via API for programmatic sample order placement and fulfillment.


    The Supply API is a RESTful service that returns JSON. Suppliers retrieve
    available survey opportunities (Surveys and Streams), read the
    qualifications and quotas attached to each Stream, generate respondent entry
    links, and reconcile completed sessions.


    ## Authentication


    Authentication is done via an obfuscated GUID (API key) associated with each
    supplier and passed in the `Authorization` header of every request. To
    obtain credentials, contact Rep Data's Supply team at supply@repdata.com.


    ## Environments


    Production URL: `https://api.researchdesk.com`  

    Staging URL: `https://stage-api.researchdesk.com`


    We recommend completing full end-to-end testing in staging before going
    live. Staging test surveys 2634 (short, 1 question) and 2635 (longer, ~10
    minutes) are available for integration testing.


    ## Responses


    Successful responses are wrapped in a standard envelope:


    ``` json

    {
        "Status": 0,
        "Message": "Success",
        "Data": { }
    }
     ```

    A `Status` of `0` indicates success. `Data` contains the endpoint-specific
    payload.
servers:
  - url: https://api.researchdesk.com
    description: Production
  - url: https://stage-api.researchdesk.com
    description: Staging
security: []
paths:
  /v2/surveys/streams/{StreamNumber}:
    get:
      summary: Get Survey by Stream
      description: >-
        Returns the parent Survey for a Stream, including SampleExclusions and
        SampleExclusionsRules. The response payload matches Get Survey.
      operationId: Surveys_GetSurveyByStream
      parameters:
        - name: Authorization
          in: header
          required: true
          description: Your obfuscated Supply API key (GUID), provided by Rep Data.
          schema:
            type: string
          example: '{{api_key}}'
        - name: StreamNumber
          in: path
          required: true
          description: StreamNumber (integer) or StreamUd (UUID).
          schema:
            type: string
          example: '850'
      responses:
        '200':
          description: The parent survey for the stream, including sample exclusion rules.
          content:
            application/json:
              schema:
                type: object
                properties:
                  Status:
                    type: integer
                    description: 0 indicates success.
                  Message:
                    type: string
                  Data:
                    type: object
                    properties:
                      SurveyName:
                        type: string
                      SurveyNumber:
                        type: integer
                      ProjectUd:
                        type: string
                        format: uuid
                        description: >-
                          UD for the parent project; used for Research Defender
                          PREDUPE.
                      SurveyUd:
                        type: string
                        format: uuid
                      SurveyStatus:
                        type: string
                        description: Draft, Live, Paused, Complete.
                      SurveyLanguage:
                        type: string
                      SurveyCountry:
                        type: string
                      PII:
                        type: boolean
                      EstimatedLOI:
                        type: integer
                      EstimatedIR:
                        type: integer
                      DeviceCompatibility:
                        type: array
                        items:
                          type: object
                          properties:
                            device_id:
                              type: integer
                            device_name:
                              type: string
                      SampleExclusions:
                        type: array
                        items:
                          type: string
                          format: uuid
                        description: >-
                          ProjectUd values for projects whose previous
                          respondents should be excluded. When
                          SampleExclusionsRules is null, treat every status as
                          excluded with a 1-year lookback.
                      SampleExclusionsRules:
                        type: object
                        nullable: true
                        description: >-
                          Scopes when SampleExclusions applies. Null is
                          equivalent to every status and a 365-day lookback.
                          Rules can only loosen that default; they cannot make
                          exclusions stricter.
                        properties:
                          Statuses:
                            type: array
                            description: >-
                              Respondent completion statuses that count toward
                              exclusion. A prior participation in any other
                              status is not excluded. Each status matches the
                              redirect used when the respondent exited.
                            items:
                              type: string
                              enum:
                                - Complete
                                - OverQuota
                                - Security
                                - Terminate
                                - Abandon
                          LookbackDays:
                            type: integer
                            description: >-
                              Number of days back prior participation is
                              considered. Participation older than this window
                              does not count toward exclusion.
                      Streams:
                        type: array
                        items:
                          type: object
                          properties:
                            StreamId:
                              type: integer
                            StreamUd:
                              type: string
                              format: uuid
                            StreamName:
                              type: string
                            StreamStatus:
                              type: string
                              description: Draft, Live, Paused, Complete, Canceled.
                            CalculationType:
                              type: string
                              description: Completes or Survey Starts.
                            Entrants:
                              type: integer
                            ExpectedStreamCompletes:
                              type: integer
                              description: Deprecated. Use Expected instead.
                            ActualStreamCompletes:
                              type: integer
                              description: Deprecated. Use Actual instead.
                            Expected:
                              type: integer
                            Actual:
                              type: integer
                            ActualIR:
                              type: integer
                            ActualLOI:
                              type: integer
                            CPI:
                              type: number
                              format: float
                            DaysInField:
                              type: integer
                            Conversion:
                              type: integer
                            Remaining:
                              type: integer
                              description: >-
                                Completes or Survey Starts still needed. Pause
                                sample when 0.
                            QualificationsLastChangedTimestamp:
                              type: string
                              format: date-time
                            QuotasLastChangedTimestamp:
                              type: string
                              format: date-time
                            B2B:
                              type: boolean
                            Recontact:
                              type: boolean
                              description: >-
                                True when the stream is a recontact stream. Only
                                PIDs returned by GET
                                /v2/lists/streams/{StreamNumber} with type
                                "recontact" are eligible. Respondents sent
                                without a matching PID are termed with isc 5008
                                (Respondent List Mismatch).
              example:
                Status: 0
                Message: Success
                Data:
                  SurveyName: US Gen Pop Survey - Short
                  SurveyNumber: 2634
                  ProjectUd: db02d54e-9b65-4a49-bb22-cfeec3a3fb62
                  SurveyUd: d6cee0a1-3c4c-4252-b502-d3dae24db9ff
                  SurveyStatus: Live
                  SurveyLanguage: en
                  SurveyCountry: US
                  PII: false
                  EstimatedLOI: 2
                  EstimatedIR: 100
                  DeviceCompatibility:
                    - device_id: 1
                      device_name: Desktop
                    - device_id: 2
                      device_name: Mobile
                    - device_id: 3
                      device_name: Tablet
                  SampleExclusions:
                    - 63099002-c17f-4fda-b8c8-29d7f33c625c
                    - 550d11c7-1b0e-4276-a96a-72004ad0bac9
                  SampleExclusionsRules:
                    Statuses:
                      - Complete
                      - Abandon
                    LookbackDays: 90
                  Streams:
                    - StreamId: 850
                      StreamUd: f1789d2b-ac7c-415b-bcb5-8b285e60e698
                      StreamName: US Gen Pop - Census Rep
                      StreamStatus: Live
                      CalculationType: Completes
                      Entrants: 0
                      ExpectedStreamCompletes: 0
                      ActualStreamCompletes: 0
                      Expected: 0
                      Actual: 0
                      ActualIR: 0
                      ActualLOI: 0
                      CPI: 0
                      DaysInField: 1
                      Conversion: 0
                      Remaining: 0
                      QualificationsLastChangedTimestamp: '2024-06-18 17:41:22'
                      QuotasLastChangedTimestamp: '2024-06-18 17:41:22'
                      B2B: false
                      Recontact: false
                    - StreamId: 853
                      StreamUd: 1ff36ea1-8181-406c-8c2c-45fc44f4f3f5
                      StreamName: High Income, Employed
                      StreamStatus: Live
                      CalculationType: Completes
                      Entrants: 0
                      ExpectedStreamCompletes: 8
                      ActualStreamCompletes: 0
                      Expected: 8
                      Actual: 0
                      ActualIR: 0
                      ActualLOI: 0
                      CPI: 0
                      DaysInField: 5
                      Conversion: 0
                      Remaining: 8
                      QualificationsLastChangedTimestamp: '2024-06-18 17:41:22'
                      QuotasLastChangedTimestamp: '2024-06-18 17:41:22'
                      B2B: false
                      Recontact: false

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.