---
title: Get table
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Reference Tables
---

# Get table{% #get-table %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                          |
| ----------------- | --------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/reference-tables/tables/{id} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/reference-tables/tables/{id} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/reference-tables/tables/{id}      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/reference-tables/tables/{id}      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/reference-tables/tables/{id}  |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/reference-tables/tables/{id}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/reference-tables/tables/{id} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/reference-tables/tables/{id} |

### Overview

Get a reference table by ID

### Arguments

#### Path Parameters

| Name                 | Type   | Description                                          |
| -------------------- | ------ | ---------------------------------------------------- |
| id [*required*] | string | Unique identifier of the reference table to retrieve |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
A reference table resource containing its full configuration and state.

| Parent field   | Field                          | Type     | Description                                                                                                                                                                                                                                                                |
| -------------- | ------------------------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                | data                           | object   | The data object containing the reference table configuration and state.                                                                                                                                                                                                    |
| data           | attributes                     | object   | Attributes that define the reference table's configuration and properties.                                                                                                                                                                                                 |
| attributes     | created_by                     | string   | UUID of the user who created the reference table.                                                                                                                                                                                                                          |
| attributes     | description                    | string   | Optional text describing the purpose or contents of this reference table.                                                                                                                                                                                                  |
| attributes     | file_metadata                  | object   | Metadata specifying where and how to access the reference table's data file.                                                                                                                                                                                               | For cloud storage tables (S3/GCS/Azure): | For local file tables: |
| file_metadata  | access_details                 | object   | Cloud storage access configuration. Only present for cloud storage sources (S3, GCS, Azure).                                                                                                                                                                               |
| access_details | aws_detail                     | object   | Amazon Web Services S3 storage access configuration.                                                                                                                                                                                                                       |
| aws_detail     | aws_account_id                 | string   | AWS account ID where the S3 bucket is located.                                                                                                                                                                                                                             |
| aws_detail     | aws_bucket_name                | string   | S3 bucket containing the CSV file.                                                                                                                                                                                                                                         |
| aws_detail     | file_path                      | string   | The relative file path from the S3 bucket root to the CSV file.                                                                                                                                                                                                            |
| access_details | azure_detail                   | object   | Azure Blob Storage access configuration.                                                                                                                                                                                                                                   |
| azure_detail   | azure_client_id                | string   | Azure service principal (application) client ID with permissions to read from the container.                                                                                                                                                                               |
| azure_detail   | azure_container_name           | string   | Azure Blob Storage container containing the CSV file.                                                                                                                                                                                                                      |
| azure_detail   | azure_storage_account_name     | string   | Azure storage account where the container is located.                                                                                                                                                                                                                      |
| azure_detail   | azure_tenant_id                | string   | Azure Active Directory tenant ID.                                                                                                                                                                                                                                          |
| azure_detail   | file_path                      | string   | The relative file path from the Azure container root to the CSV file.                                                                                                                                                                                                      |
| access_details | gcp_detail                     | object   | Google Cloud Platform storage access configuration.                                                                                                                                                                                                                        |
| gcp_detail     | file_path                      | string   | The relative file path from the GCS bucket root to the CSV file.                                                                                                                                                                                                           |
| gcp_detail     | gcp_bucket_name                | string   | GCP bucket containing the CSV file.                                                                                                                                                                                                                                        |
| gcp_detail     | gcp_project_id                 | string   | GCP project ID where the bucket is located.                                                                                                                                                                                                                                |
| gcp_detail     | gcp_service_account_email      | string   | Service account email with read permissions for the GCS bucket.                                                                                                                                                                                                            |
| file_metadata  | error_message                  | string   | The error message returned from the last operation (sync for cloud storage, upload for local file).                                                                                                                                                                        |
| file_metadata  | error_row_count                | int64    | The number of rows that failed to process.                                                                                                                                                                                                                                 |
| file_metadata  | error_type                     | enum     | The type of error that occurred during file processing. Only applicable for cloud storage sources. Allowed enum values: `TABLE_SCHEMA_ERROR,FILE_FORMAT_ERROR,CONFIGURATION_ERROR,QUOTA_EXCEEDED,CONFLICT_ERROR,VALIDATION_ERROR,STATE_ERROR,OPERATION_ERROR,SYSTEM_ERROR` |
| file_metadata  | sync_enabled                   | boolean  | Whether this table is synced automatically from cloud storage. Only applicable for cloud storage sources.                                                                                                                                                                  |
| attributes     | last_updated_by                | string   | UUID of the user who last updated the reference table.                                                                                                                                                                                                                     |
| attributes     | row_count                      | int64    | The number of successfully processed rows in the reference table.                                                                                                                                                                                                          |
| attributes     | schema                         | object   | Schema defining the structure and columns of the reference table.                                                                                                                                                                                                          |
| schema         | fields [*required*]       | [object] | The schema fields.                                                                                                                                                                                                                                                         |
| fields         | name [*required*]         | string   | The field name.                                                                                                                                                                                                                                                            |
| fields         | type [*required*]         | enum     | The field type for reference table schema fields. Allowed enum values: `STRING,INT32`                                                                                                                                                                                      |
| schema         | primary_keys [*required*] | [string] | List of field names that serve as primary keys for the table. Only one primary key is supported, and it is used as an ID to retrieve rows.                                                                                                                                 |
| attributes     | source                         | enum     | The source type for reference table data. Includes all possible source types that can appear in responses. Allowed enum values: `LOCAL_FILE,S3,GCS,AZURE,SERVICENOW,SALESFORCE,DATABRICKS,SNOWFLAKE`                                                                       |
| attributes     | status                         | string   | The processing status of the table.                                                                                                                                                                                                                                        |
| attributes     | table_name                     | string   | Unique name to identify this reference table. Used in enrichment processors and API calls.                                                                                                                                                                                 |
| attributes     | tags                           | [string] | Tags for organizing and filtering reference tables.                                                                                                                                                                                                                        |
| attributes     | updated_at                     | string   | When the reference table was last updated, in ISO 8601 format.                                                                                                                                                                                                             |
| data           | id                             | string   | Unique identifier for the reference table.                                                                                                                                                                                                                                 |
| data           | type [*required*]         | enum     | Reference table resource type. Allowed enum values: `reference_table`                                                                                                                                                                                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "created_by": "00000000-0000-0000-0000-000000000000",
      "description": "example description",
      "file_metadata": {
        "access_details": {
          "aws_detail": {
            "aws_account_id": "123456789000",
            "aws_bucket_name": "my-bucket",
            "file_path": "path/to/file.csv"
          }
        },
        "sync_enabled": true
      },
      "last_updated_by": "00000000-0000-0000-0000-000000000000",
      "row_count": 5,
      "schema": {
        "fields": [
          {
            "name": "id",
            "type": "INT32"
          },
          {
            "name": "name",
            "type": "STRING"
          }
        ],
        "primary_keys": [
          "id"
        ]
      },
      "source": "S3",
      "status": "DONE",
      "table_name": "test_reference_table",
      "tags": [
        "tag1",
        "tag2"
      ],
      "updated_at": "2000-01-01T01:00:00+00:00"
    },
    "id": "00000000-0000-0000-0000-000000000000",
    "type": "reference_table"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="404" %}
Not Found
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \# Path parameters export id="CHANGE_ME" \# Curl command curl -X GET "https://api.datadoghq.com/api/v2/reference-tables/tables/${id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
##### 

```python
"""
Get table returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.reference_tables_api import ReferenceTablesApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = ReferenceTablesApi(api_client)
    response = api_instance.get_table(
        id="id",
    )

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
##### 

```ruby
# Get table returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::ReferenceTablesAPI.new
p api_instance.get_table("id")
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
##### 

```go
// Get table returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewReferenceTablesApi(apiClient)
	resp, r, err := api.GetTable(ctx, "id")

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ReferenceTablesApi.GetTable`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `ReferenceTablesApi.GetTable`:\n%s\n", responseContent)
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
##### 

```java
// Get table returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ReferenceTablesApi;
import com.datadog.api.client.v2.model.TableResultV2;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    ReferenceTablesApi apiInstance = new ReferenceTablesApi(defaultClient);

    try {
      TableResultV2 result = apiInstance.getTable("id");
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ReferenceTablesApi#getTable");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Get table returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_reference_tables::ReferenceTablesAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = ReferenceTablesAPI::with_config(configuration);
    let resp = api.get_table("id".to_string()).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Get table returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.ReferenceTablesApi(configuration);

const params: v2.ReferenceTablesApiGetTableRequest = {
  id: "id",
};

apiInstance
  .getTable(params)
  .then((data: v2.TableResultV2) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}
