# Retrieve status of query

Retrieve the status of a query.

Endpoint: GET /audiences/{audienceId}/segments/queries/{queryId}
Version: 1.0.0
Security: TdApikeyAuth

## Security:

  - `TdApikeyAuth` (unknown)
    apiKey in header Authorization

## Path parameters:

  - `audienceId` (integer, required)
    Audience ID of the segment

  - `queryId` (integer, required)
    ID of query

## Response 200:

  - `200` (unknown)
    successful operation

## Response 200 fields (application/json):

  - `id` (string)
    Query identifier (may be UUID or platform-specific ID like job ID or statement handle)

  - `queryId` (string)
    Same value as `id`.

  - `status` (string)
    Enum: "success", "killed", "error", "running"

  - `count` (integer)
    Number of profiles produced by the given segment rules

  - `maxPage` (integer)

  - `error` (string)

  - `jobid` (string)

  - `countJobid` (string)

  - `customerGroupCount` (integer)
    Number of customer groups related by the given segment rules

## Response 400:

  - `400` (unknown)
    Given parameters are not valid

## Response 400 fields (application/json):

  - `code` (string, required)

  - `message` (string, required)

## Response 401:

  - `401` (unknown)
    Unauthorized; You don't provide valid credentials. Maybe you didn't specify valid TD's Master API Key as 'TD1 {Your TD Master API Key}'.

## Response 401 fields (application/json):

  - `code` (string, required)

  - `message` (string, required)

## Response 403:

  - `403` (unknown)
    Requested resource or action is not allowed because you don't have sufficient permissions

## Response 403 fields (application/json):

  - `code` (string, required)

  - `message` (string, required)

## Response 404:

  - `404` (unknown)
    The specified resource was not found

## Response 404 fields (application/json):

  - `code` (string, required)

  - `message` (string, required)

## Response 4XX:

  - `4XX` (unknown)
    There is a high possibility of error of the authentication system. Please check the contents and authority of the key. Please contact the TD support team if you do not resolve it.

## Response 4XX fields (application/json):

  - `code` (string, required)

  - `message` (string, required)

## Response 5XX:

  - `5XX` (unknown)
    System error. Because there is a possibility of a temporary error due to network trouble and so on, we recommend several times retry on request side. Please contact the TD support team if you do not resolve it.

## Response 5XX fields (application/json):

  - `status` (integer, required)
    Error status

  - `error` (string, required)
    Error message

  - `details` (string)
    Detailed error message

