Skip to content

Get a query's status (poll it until it finishes)

GET
https://audit.ezghcloud.com/v1/organizations/{orgId}/queries/{queryId}

Authorization

  • apiKeyoptionalHTTP
  • oauthoptionalHTTP
  • sessionCookieoptionalAPI key in cookie

Path parameters

  • orgIdstringrequired

    The organization.

    format: uuid
  • queryIdstringrequired

    The query.

    format: uuid

Returns

200

The query. While it's queued or running, Retry-After suggests when to poll again.

JSON
  • cancelRequestedbooleanrequired
  • createdAtstringrequired
    format: date-time
  • createdBystringrequired

    The principal who started it.

  • fromstringrequired
    format: date-time
  • idstringrequired
    format: uuid
  • queuePositioninteger | nullrequired

    Its place in the organization's line while it's queued (1 is next), in GetQuery's answer; null otherwise, and in lists.

    format: int64
  • sqlstringrequired
  • statusstringrequired

    queued, running, succeeded, failed or cancelled.

  • tostringrequired
    format: date-time
  • truncatedbooleanrequired
  • createdByIdentityoptionalobject | null
  • erroroptionalQueryErrorornull
    2 variants

    One of the following:

    • QueryError
      2 properties
      • codestringrequired

        timeout, memory_limit, too_much_data, quota_exceeded, query_too_large, cancelled, worker_lost, invalid_query or query_failed.

      • messageoptionalstring | null
    • null
  • finishedAtoptionalstring | null
  • resultRowsoptionalinteger | null
    format: int64
  • startedAtoptionalstring | null
  • statsoptionalQueryStatsornull
    2 variants

    One of the following:

    • QueryStats
      4 properties
      • bytesScannedstringrequired

        Bytes read, as a decimal string: it can exceed 2^53.

        format: int64, pattern: ^(0|[1-9][0-9]{0,18})$
        Example: "5020"
      • elapsedMsintegerrequired
        format: int64, minimum: 0
      • resultRowsintegerrequired
        format: int64, minimum: 0
      • rowsScannedintegerrequired
        format: int64, minimum: 0
    • null

400

invalid_request, invalid_cursor, invalid_query (with line and column), or lookup_too_broad.

JSON
  • errorobjectrequired
    6 properties
    • codestringrequired
      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired
      maxLength: 1024
    • columnoptionalinteger

      invalid_query: where the SQL went wrong.

    • lineoptionalinteger

      invalid_query: where the SQL went wrong.

    • quotaoptionalobject

      quota_exceeded: the quota that refused the request. Trails Query's are audit.queries.queriesPerHour and audit.queries.bytesReadPerHour, rate quotas with a PT1H window. Never with Retry-After.

      11 properties
      • idstringrequired
      • kindallocationorrateorusageorconcurrencyrequired
      • limitintegerrequired
        minimum: 0
      • scopeorganizationorprojectorresourcerequired
      • inFlightoptionalinteger
        minimum: 0
      • periodStartoptionalstring
        format: date-time
      • regionoptionalstring
      • resetsAtoptionalstring
        format: date-time
      • scopeResourceNameoptionalstring
      • usedoptionalinteger
        minimum: 0
      • windowoptionalstring

        rate only: an ISO 8601 duration, PT1S to PT1H.

    • reasonoptionalstring

      query_failed: the query's own error code.

401

unauthenticated: no credential, or one that doesn't check out.

JSON
  • errorobjectrequired
    6 properties
    • codestringrequired
      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired
      maxLength: 1024
    • columnoptionalinteger

      invalid_query: where the SQL went wrong.

    • lineoptionalinteger

      invalid_query: where the SQL went wrong.

    • quotaoptionalobject

      quota_exceeded: the quota that refused the request. Trails Query's are audit.queries.queriesPerHour and audit.queries.bytesReadPerHour, rate quotas with a PT1H window. Never with Retry-After.

      11 properties
      • idstringrequired
      • kindallocationorrateorusageorconcurrencyrequired
      • limitintegerrequired
        minimum: 0
      • scopeorganizationorprojectorresourcerequired
      • inFlightoptionalinteger
        minimum: 0
      • periodStartoptionalstring
        format: date-time
      • regionoptionalstring
      • resetsAtoptionalstring
        format: date-time
      • scopeResourceNameoptionalstring
      • usedoptionalinteger
        minimum: 0
      • windowoptionalstring

        rate only: an ISO 8601 duration, PT1S to PT1H.

    • reasonoptionalstring

      query_failed: the query's own error code.

403

access_denied: the caller's policies don't allow the action; forbidden_origin: a cookie-authenticated write from an origin that isn't allowed.

JSON
  • errorobjectrequired
    6 properties
    • codestringrequired
      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired
      maxLength: 1024
    • columnoptionalinteger

      invalid_query: where the SQL went wrong.

    • lineoptionalinteger

      invalid_query: where the SQL went wrong.

    • quotaoptionalobject

      quota_exceeded: the quota that refused the request. Trails Query's are audit.queries.queriesPerHour and audit.queries.bytesReadPerHour, rate quotas with a PT1H window. Never with Retry-After.

      11 properties
      • idstringrequired
      • kindallocationorrateorusageorconcurrencyrequired
      • limitintegerrequired
        minimum: 0
      • scopeorganizationorprojectorresourcerequired
      • inFlightoptionalinteger
        minimum: 0
      • periodStartoptionalstring
        format: date-time
      • regionoptionalstring
      • resetsAtoptionalstring
        format: date-time
      • scopeResourceNameoptionalstring
      • usedoptionalinteger
        minimum: 0
      • windowoptionalstring

        rate only: an ISO 8601 duration, PT1S to PT1H.

    • reasonoptionalstring

      query_failed: the query's own error code.

404

not_found: unknown, malformed, or in an organization the caller isn't in.

JSON
  • errorobjectrequired
    6 properties
    • codestringrequired
      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired
      maxLength: 1024
    • columnoptionalinteger

      invalid_query: where the SQL went wrong.

    • lineoptionalinteger

      invalid_query: where the SQL went wrong.

    • quotaoptionalobject

      quota_exceeded: the quota that refused the request. Trails Query's are audit.queries.queriesPerHour and audit.queries.bytesReadPerHour, rate quotas with a PT1H window. Never with Retry-After.

      11 properties
      • idstringrequired
      • kindallocationorrateorusageorconcurrencyrequired
      • limitintegerrequired
        minimum: 0
      • scopeorganizationorprojectorresourcerequired
      • inFlightoptionalinteger
        minimum: 0
      • periodStartoptionalstring
        format: date-time
      • regionoptionalstring
      • resetsAtoptionalstring
        format: date-time
      • scopeResourceNameoptionalstring
      • usedoptionalinteger
        minimum: 0
      • windowoptionalstring

        rate only: an ISO 8601 duration, PT1S to PT1H.

    • reasonoptionalstring

      query_failed: the query's own error code.

429

too_many_requests or too_many_queries, with Retry-After; or quota_exceeded (with quota), never with Retry-After.

JSON
  • errorobjectrequired
    6 properties
    • codestringrequired
      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired
      maxLength: 1024
    • columnoptionalinteger

      invalid_query: where the SQL went wrong.

    • lineoptionalinteger

      invalid_query: where the SQL went wrong.

    • quotaoptionalobject

      quota_exceeded: the quota that refused the request. Trails Query's are audit.queries.queriesPerHour and audit.queries.bytesReadPerHour, rate quotas with a PT1H window. Never with Retry-After.

      11 properties
      • idstringrequired
      • kindallocationorrateorusageorconcurrencyrequired
      • limitintegerrequired
        minimum: 0
      • scopeorganizationorprojectorresourcerequired
      • inFlightoptionalinteger
        minimum: 0
      • periodStartoptionalstring
        format: date-time
      • regionoptionalstring
      • resetsAtoptionalstring
        format: date-time
      • scopeResourceNameoptionalstring
      • usedoptionalinteger
        minimum: 0
      • windowoptionalstring

        rate only: an ISO 8601 duration, PT1S to PT1H.

    • reasonoptionalstring

      query_failed: the query's own error code.

500

internal_error: a bug; the details are in the logs, under the request ID.

JSON
  • errorobjectrequired
    6 properties
    • codestringrequired
      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired
      maxLength: 1024
    • columnoptionalinteger

      invalid_query: where the SQL went wrong.

    • lineoptionalinteger

      invalid_query: where the SQL went wrong.

    • quotaoptionalobject

      quota_exceeded: the quota that refused the request. Trails Query's are audit.queries.queriesPerHour and audit.queries.bytesReadPerHour, rate quotas with a PT1H window. Never with Retry-After.

      11 properties
      • idstringrequired
      • kindallocationorrateorusageorconcurrencyrequired
      • limitintegerrequired
        minimum: 0
      • scopeorganizationorprojectorresourcerequired
      • inFlightoptionalinteger
        minimum: 0
      • periodStartoptionalstring
        format: date-time
      • regionoptionalstring
      • resetsAtoptionalstring
        format: date-time
      • scopeResourceNameoptionalstring
      • usedoptionalinteger
        minimum: 0
      • windowoptionalstring

        rate only: an ISO 8601 duration, PT1S to PT1H.

    • reasonoptionalstring

      query_failed: the query's own error code.

503

unavailable: a dependency the request needs is down. Retry after Retry-After.

JSON
  • errorobjectrequired
    6 properties
    • codestringrequired
      maxLength: 64, pattern: ^[a-z][a-z0-9_]*$
    • messagestringrequired
      maxLength: 1024
    • columnoptionalinteger

      invalid_query: where the SQL went wrong.

    • lineoptionalinteger

      invalid_query: where the SQL went wrong.

    • quotaoptionalobject

      quota_exceeded: the quota that refused the request. Trails Query's are audit.queries.queriesPerHour and audit.queries.bytesReadPerHour, rate quotas with a PT1H window. Never with Retry-After.

      11 properties
      • idstringrequired
      • kindallocationorrateorusageorconcurrencyrequired
      • limitintegerrequired
        minimum: 0
      • scopeorganizationorprojectorresourcerequired
      • inFlightoptionalinteger
        minimum: 0
      • periodStartoptionalstring
        format: date-time
      • regionoptionalstring
      • resetsAtoptionalstring
        format: date-time
      • scopeResourceNameoptionalstring
      • usedoptionalinteger
        minimum: 0
      • windowoptionalstring

        rate only: an ISO 8601 duration, PT1S to PT1H.

    • reasonoptionalstring

      query_failed: the query's own error code.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close