---
title: "The trails table's columns, and the functions queries may use"
---

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

Path: Trails API › queries

`GET /v1/organizations/{orgId}/queries/schema`

## Authentication

Requires one of the following:

- `apiKey`, http, header `Authorization`
- `oauth`, http, header `Authorization`
- `sessionCookie`, apiKey, in cookie

## Path parameters

- `GetQuerySchema.path.orgId` (string, required) — The organization.
  - format `uuid`

## Code samples

### cURL

```curl
curl --request GET \
  --url https://audit.ezghcloud.com/v1/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/queries/schema \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://audit.ezghcloud.com/v1/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/queries/schema';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://audit.ezghcloud.com/v1/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/queries/schema"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

The schema.

#### Example

```json
{
  "columns": [
    {
      "description": "string",
      "name": "string",
      "nullable": true,
      "type": "string"
    }
  ],
  "functions": [
    {
      "category": "string",
      "kind": "string",
      "name": "string"
    }
  ],
  "table": "string"
}
```

- `GetQuerySchema.response.200.columns` (array<object>, required)
  - `GetQuerySchema.response.200.columns.description` (string, required)
  - `GetQuerySchema.response.200.columns.name` (string, required)
  - `GetQuerySchema.response.200.columns.nullable` (boolean, required) — Whether the column can be NULL.
  - `GetQuerySchema.response.200.columns.type` (string, required) — string, uuid, timestamp, boolean, integer, number, json or array. Clients treat other values as string.
- `GetQuerySchema.response.200.functions` (array<object>, required)
  - `GetQuerySchema.response.200.functions.category` (string, required)
  - `GetQuerySchema.response.200.functions.kind` (string, required)
  - `GetQuerySchema.response.200.functions.name` (string, required)
- `GetQuerySchema.response.200.table` (string, required)

### 400

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

#### Example

```json
{
  "error": {
    "code": "string",
    "column": 0,
    "line": 0,
    "message": "string",
    "quota": {
      "id": "string",
      "inFlight": 0,
      "kind": "allocation",
      "limit": 0,
      "periodStart": "2019-08-24T14:15:22Z",
      "region": "string",
      "resetsAt": "2019-08-24T14:15:22Z",
      "scope": "organization",
      "scopeResourceName": "string",
      "used": 0,
      "window": "string"
    },
    "reason": "string"
  }
}
```

- `GetQuerySchema.response.400.error` (object, required)
  - `GetQuerySchema.response.400.error.code` (string, required)
    - maxLength 64; pattern `^[a-z][a-z0-9_]*$`
  - `GetQuerySchema.response.400.error.message` (string, required)
    - maxLength 1024
  - `GetQuerySchema.response.400.error.column` (integer, optional) — invalid_query: where the SQL went wrong.
  - `GetQuerySchema.response.400.error.line` (integer, optional) — invalid_query: where the SQL went wrong.
  - `GetQuerySchema.response.400.error.quota` (object, optional) — 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.
    - `GetQuerySchema.response.400.error.quota.id` (string, required)
    - `GetQuerySchema.response.400.error.quota.kind` (unknown, required)
      - one of `"allocation"`, `"rate"`, `"usage"`, `"concurrency"`
    - `GetQuerySchema.response.400.error.quota.limit` (integer, required)
      - min 0
    - `GetQuerySchema.response.400.error.quota.scope` (unknown, required)
      - one of `"organization"`, `"project"`, `"resource"`
    - `GetQuerySchema.response.400.error.quota.inFlight` (integer, optional)
      - min 0
    - `GetQuerySchema.response.400.error.quota.periodStart` (string, optional)
      - format `date-time`
    - `GetQuerySchema.response.400.error.quota.region` (string, optional)
    - `GetQuerySchema.response.400.error.quota.resetsAt` (string, optional)
      - format `date-time`
    - `GetQuerySchema.response.400.error.quota.scopeResourceName` (string, optional)
    - `GetQuerySchema.response.400.error.quota.used` (integer, optional)
      - min 0
    - `GetQuerySchema.response.400.error.quota.window` (string, optional) — rate only: an ISO 8601 duration, PT1S to PT1H.
  - `GetQuerySchema.response.400.error.reason` (string, optional) — query_failed: the query's own error code.

### 401

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

#### Example

```json
{
  "error": {
    "code": "string",
    "column": 0,
    "line": 0,
    "message": "string",
    "quota": {
      "id": "string",
      "inFlight": 0,
      "kind": "allocation",
      "limit": 0,
      "periodStart": "2019-08-24T14:15:22Z",
      "region": "string",
      "resetsAt": "2019-08-24T14:15:22Z",
      "scope": "organization",
      "scopeResourceName": "string",
      "used": 0,
      "window": "string"
    },
    "reason": "string"
  }
}
```

- `GetQuerySchema.response.401.error` (object, required)
  - `GetQuerySchema.response.401.error.code` (string, required)
    - maxLength 64; pattern `^[a-z][a-z0-9_]*$`
  - `GetQuerySchema.response.401.error.message` (string, required)
    - maxLength 1024
  - `GetQuerySchema.response.401.error.column` (integer, optional) — invalid_query: where the SQL went wrong.
  - `GetQuerySchema.response.401.error.line` (integer, optional) — invalid_query: where the SQL went wrong.
  - `GetQuerySchema.response.401.error.quota` (object, optional) — 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.
    - `GetQuerySchema.response.401.error.quota.id` (string, required)
    - `GetQuerySchema.response.401.error.quota.kind` (unknown, required)
      - one of `"allocation"`, `"rate"`, `"usage"`, `"concurrency"`
    - `GetQuerySchema.response.401.error.quota.limit` (integer, required)
      - min 0
    - `GetQuerySchema.response.401.error.quota.scope` (unknown, required)
      - one of `"organization"`, `"project"`, `"resource"`
    - `GetQuerySchema.response.401.error.quota.inFlight` (integer, optional)
      - min 0
    - `GetQuerySchema.response.401.error.quota.periodStart` (string, optional)
      - format `date-time`
    - `GetQuerySchema.response.401.error.quota.region` (string, optional)
    - `GetQuerySchema.response.401.error.quota.resetsAt` (string, optional)
      - format `date-time`
    - `GetQuerySchema.response.401.error.quota.scopeResourceName` (string, optional)
    - `GetQuerySchema.response.401.error.quota.used` (integer, optional)
      - min 0
    - `GetQuerySchema.response.401.error.quota.window` (string, optional) — rate only: an ISO 8601 duration, PT1S to PT1H.
  - `GetQuerySchema.response.401.error.reason` (string, optional) — 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.

#### Example

```json
{
  "error": {
    "code": "string",
    "column": 0,
    "line": 0,
    "message": "string",
    "quota": {
      "id": "string",
      "inFlight": 0,
      "kind": "allocation",
      "limit": 0,
      "periodStart": "2019-08-24T14:15:22Z",
      "region": "string",
      "resetsAt": "2019-08-24T14:15:22Z",
      "scope": "organization",
      "scopeResourceName": "string",
      "used": 0,
      "window": "string"
    },
    "reason": "string"
  }
}
```

- `GetQuerySchema.response.403.error` (object, required)
  - `GetQuerySchema.response.403.error.code` (string, required)
    - maxLength 64; pattern `^[a-z][a-z0-9_]*$`
  - `GetQuerySchema.response.403.error.message` (string, required)
    - maxLength 1024
  - `GetQuerySchema.response.403.error.column` (integer, optional) — invalid_query: where the SQL went wrong.
  - `GetQuerySchema.response.403.error.line` (integer, optional) — invalid_query: where the SQL went wrong.
  - `GetQuerySchema.response.403.error.quota` (object, optional) — 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.
    - `GetQuerySchema.response.403.error.quota.id` (string, required)
    - `GetQuerySchema.response.403.error.quota.kind` (unknown, required)
      - one of `"allocation"`, `"rate"`, `"usage"`, `"concurrency"`
    - `GetQuerySchema.response.403.error.quota.limit` (integer, required)
      - min 0
    - `GetQuerySchema.response.403.error.quota.scope` (unknown, required)
      - one of `"organization"`, `"project"`, `"resource"`
    - `GetQuerySchema.response.403.error.quota.inFlight` (integer, optional)
      - min 0
    - `GetQuerySchema.response.403.error.quota.periodStart` (string, optional)
      - format `date-time`
    - `GetQuerySchema.response.403.error.quota.region` (string, optional)
    - `GetQuerySchema.response.403.error.quota.resetsAt` (string, optional)
      - format `date-time`
    - `GetQuerySchema.response.403.error.quota.scopeResourceName` (string, optional)
    - `GetQuerySchema.response.403.error.quota.used` (integer, optional)
      - min 0
    - `GetQuerySchema.response.403.error.quota.window` (string, optional) — rate only: an ISO 8601 duration, PT1S to PT1H.
  - `GetQuerySchema.response.403.error.reason` (string, optional) — query_failed: the query's own error code.

### 404

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

#### Example

```json
{
  "error": {
    "code": "string",
    "column": 0,
    "line": 0,
    "message": "string",
    "quota": {
      "id": "string",
      "inFlight": 0,
      "kind": "allocation",
      "limit": 0,
      "periodStart": "2019-08-24T14:15:22Z",
      "region": "string",
      "resetsAt": "2019-08-24T14:15:22Z",
      "scope": "organization",
      "scopeResourceName": "string",
      "used": 0,
      "window": "string"
    },
    "reason": "string"
  }
}
```

- `GetQuerySchema.response.404.error` (object, required)
  - `GetQuerySchema.response.404.error.code` (string, required)
    - maxLength 64; pattern `^[a-z][a-z0-9_]*$`
  - `GetQuerySchema.response.404.error.message` (string, required)
    - maxLength 1024
  - `GetQuerySchema.response.404.error.column` (integer, optional) — invalid_query: where the SQL went wrong.
  - `GetQuerySchema.response.404.error.line` (integer, optional) — invalid_query: where the SQL went wrong.
  - `GetQuerySchema.response.404.error.quota` (object, optional) — 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.
    - `GetQuerySchema.response.404.error.quota.id` (string, required)
    - `GetQuerySchema.response.404.error.quota.kind` (unknown, required)
      - one of `"allocation"`, `"rate"`, `"usage"`, `"concurrency"`
    - `GetQuerySchema.response.404.error.quota.limit` (integer, required)
      - min 0
    - `GetQuerySchema.response.404.error.quota.scope` (unknown, required)
      - one of `"organization"`, `"project"`, `"resource"`
    - `GetQuerySchema.response.404.error.quota.inFlight` (integer, optional)
      - min 0
    - `GetQuerySchema.response.404.error.quota.periodStart` (string, optional)
      - format `date-time`
    - `GetQuerySchema.response.404.error.quota.region` (string, optional)
    - `GetQuerySchema.response.404.error.quota.resetsAt` (string, optional)
      - format `date-time`
    - `GetQuerySchema.response.404.error.quota.scopeResourceName` (string, optional)
    - `GetQuerySchema.response.404.error.quota.used` (integer, optional)
      - min 0
    - `GetQuerySchema.response.404.error.quota.window` (string, optional) — rate only: an ISO 8601 duration, PT1S to PT1H.
  - `GetQuerySchema.response.404.error.reason` (string, optional) — 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.

#### Example

```json
{
  "error": {
    "code": "string",
    "column": 0,
    "line": 0,
    "message": "string",
    "quota": {
      "id": "string",
      "inFlight": 0,
      "kind": "allocation",
      "limit": 0,
      "periodStart": "2019-08-24T14:15:22Z",
      "region": "string",
      "resetsAt": "2019-08-24T14:15:22Z",
      "scope": "organization",
      "scopeResourceName": "string",
      "used": 0,
      "window": "string"
    },
    "reason": "string"
  }
}
```

- `GetQuerySchema.response.429.error` (object, required)
  - `GetQuerySchema.response.429.error.code` (string, required)
    - maxLength 64; pattern `^[a-z][a-z0-9_]*$`
  - `GetQuerySchema.response.429.error.message` (string, required)
    - maxLength 1024
  - `GetQuerySchema.response.429.error.column` (integer, optional) — invalid_query: where the SQL went wrong.
  - `GetQuerySchema.response.429.error.line` (integer, optional) — invalid_query: where the SQL went wrong.
  - `GetQuerySchema.response.429.error.quota` (object, optional) — 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.
    - `GetQuerySchema.response.429.error.quota.id` (string, required)
    - `GetQuerySchema.response.429.error.quota.kind` (unknown, required)
      - one of `"allocation"`, `"rate"`, `"usage"`, `"concurrency"`
    - `GetQuerySchema.response.429.error.quota.limit` (integer, required)
      - min 0
    - `GetQuerySchema.response.429.error.quota.scope` (unknown, required)
      - one of `"organization"`, `"project"`, `"resource"`
    - `GetQuerySchema.response.429.error.quota.inFlight` (integer, optional)
      - min 0
    - `GetQuerySchema.response.429.error.quota.periodStart` (string, optional)
      - format `date-time`
    - `GetQuerySchema.response.429.error.quota.region` (string, optional)
    - `GetQuerySchema.response.429.error.quota.resetsAt` (string, optional)
      - format `date-time`
    - `GetQuerySchema.response.429.error.quota.scopeResourceName` (string, optional)
    - `GetQuerySchema.response.429.error.quota.used` (integer, optional)
      - min 0
    - `GetQuerySchema.response.429.error.quota.window` (string, optional) — rate only: an ISO 8601 duration, PT1S to PT1H.
  - `GetQuerySchema.response.429.error.reason` (string, optional) — query_failed: the query's own error code.

### 500

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

#### Example

```json
{
  "error": {
    "code": "string",
    "column": 0,
    "line": 0,
    "message": "string",
    "quota": {
      "id": "string",
      "inFlight": 0,
      "kind": "allocation",
      "limit": 0,
      "periodStart": "2019-08-24T14:15:22Z",
      "region": "string",
      "resetsAt": "2019-08-24T14:15:22Z",
      "scope": "organization",
      "scopeResourceName": "string",
      "used": 0,
      "window": "string"
    },
    "reason": "string"
  }
}
```

- `GetQuerySchema.response.500.error` (object, required)
  - `GetQuerySchema.response.500.error.code` (string, required)
    - maxLength 64; pattern `^[a-z][a-z0-9_]*$`
  - `GetQuerySchema.response.500.error.message` (string, required)
    - maxLength 1024
  - `GetQuerySchema.response.500.error.column` (integer, optional) — invalid_query: where the SQL went wrong.
  - `GetQuerySchema.response.500.error.line` (integer, optional) — invalid_query: where the SQL went wrong.
  - `GetQuerySchema.response.500.error.quota` (object, optional) — 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.
    - `GetQuerySchema.response.500.error.quota.id` (string, required)
    - `GetQuerySchema.response.500.error.quota.kind` (unknown, required)
      - one of `"allocation"`, `"rate"`, `"usage"`, `"concurrency"`
    - `GetQuerySchema.response.500.error.quota.limit` (integer, required)
      - min 0
    - `GetQuerySchema.response.500.error.quota.scope` (unknown, required)
      - one of `"organization"`, `"project"`, `"resource"`
    - `GetQuerySchema.response.500.error.quota.inFlight` (integer, optional)
      - min 0
    - `GetQuerySchema.response.500.error.quota.periodStart` (string, optional)
      - format `date-time`
    - `GetQuerySchema.response.500.error.quota.region` (string, optional)
    - `GetQuerySchema.response.500.error.quota.resetsAt` (string, optional)
      - format `date-time`
    - `GetQuerySchema.response.500.error.quota.scopeResourceName` (string, optional)
    - `GetQuerySchema.response.500.error.quota.used` (integer, optional)
      - min 0
    - `GetQuerySchema.response.500.error.quota.window` (string, optional) — rate only: an ISO 8601 duration, PT1S to PT1H.
  - `GetQuerySchema.response.500.error.reason` (string, optional) — query_failed: the query's own error code.

### 503

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

#### Example

```json
{
  "error": {
    "code": "string",
    "column": 0,
    "line": 0,
    "message": "string",
    "quota": {
      "id": "string",
      "inFlight": 0,
      "kind": "allocation",
      "limit": 0,
      "periodStart": "2019-08-24T14:15:22Z",
      "region": "string",
      "resetsAt": "2019-08-24T14:15:22Z",
      "scope": "organization",
      "scopeResourceName": "string",
      "used": 0,
      "window": "string"
    },
    "reason": "string"
  }
}
```

- `GetQuerySchema.response.503.error` (object, required)
  - `GetQuerySchema.response.503.error.code` (string, required)
    - maxLength 64; pattern `^[a-z][a-z0-9_]*$`
  - `GetQuerySchema.response.503.error.message` (string, required)
    - maxLength 1024
  - `GetQuerySchema.response.503.error.column` (integer, optional) — invalid_query: where the SQL went wrong.
  - `GetQuerySchema.response.503.error.line` (integer, optional) — invalid_query: where the SQL went wrong.
  - `GetQuerySchema.response.503.error.quota` (object, optional) — 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.
    - `GetQuerySchema.response.503.error.quota.id` (string, required)
    - `GetQuerySchema.response.503.error.quota.kind` (unknown, required)
      - one of `"allocation"`, `"rate"`, `"usage"`, `"concurrency"`
    - `GetQuerySchema.response.503.error.quota.limit` (integer, required)
      - min 0
    - `GetQuerySchema.response.503.error.quota.scope` (unknown, required)
      - one of `"organization"`, `"project"`, `"resource"`
    - `GetQuerySchema.response.503.error.quota.inFlight` (integer, optional)
      - min 0
    - `GetQuerySchema.response.503.error.quota.periodStart` (string, optional)
      - format `date-time`
    - `GetQuerySchema.response.503.error.quota.region` (string, optional)
    - `GetQuerySchema.response.503.error.quota.resetsAt` (string, optional)
      - format `date-time`
    - `GetQuerySchema.response.503.error.quota.scopeResourceName` (string, optional)
    - `GetQuerySchema.response.503.error.quota.used` (integer, optional)
      - min 0
    - `GetQuerySchema.response.503.error.quota.window` (string, optional) — rate only: an ISO 8601 duration, PT1S to PT1H.
  - `GetQuerySchema.response.503.error.reason` (string, optional) — query_failed: the query's own error code.


Source: https://docs.ezghcloud.com/trails-api/queries/GetQuerySchema/index.md
