---
title: "Create reference table"
method: POST
path: "/api/v2/reference-tables/tables"
tags: ["Reference Tables"]
---

# Create reference table

`POST /api/v2/reference-tables/tables`

Creates a reference table. You can provide data in two ways:
1. Call POST /api/v2/reference-tables/upload to get an upload ID. Then, PUT the CSV data
   (not the file itself) in chunks to each URL in the request body. Finally, call this
   POST endpoint with `upload_id` in `file_metadata`.
2. Provide `access_details` in `file_metadata` pointing to a CSV file in cloud storage.

## Request body

- CreateTableRequest — Request body for creating a new reference table from a local file or cloud storage.
  - `data` CreateTableRequestData — The data object containing the table definition.
    - `attributes` CreateTableRequestDataAttributes — Attributes that define the reference table's configuration and properties.
      - `description` string — Optional text describing the purpose or contents of this reference table.
      - `file_metadata` union — Metadata specifying where and how to access the reference table's data file.
        - CreateTableRequestDataAttributesFileMetadataCloudStorage — Cloud storage file metadata for create requests. Both access_details and sync_enabled are required.
          - `access_details` CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails, required — Cloud storage access configuration for the reference table data file.
            - `aws_detail` CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail — Amazon Web Services S3 storage access configuration.
              - …
            - `azure_detail` CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail — Azure Blob Storage access configuration.
              - …
            - `gcp_detail` CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail — Google Cloud Platform storage access configuration.
              - …
          - `sync_enabled` boolean, required — Whether this table is synced automatically.
        - CreateTableRequestDataAttributesFileMetadataLocalFile — Local file metadata for create requests using the upload ID.
          - `upload_id` string, required — The upload ID.
      - `schema` CreateTableRequestDataAttributesSchema, required — Schema defining the structure and columns of the reference table.
        - `fields` CreateTableRequestDataAttributesSchemaFieldsItems[], required — The schema fields.
          - `name` string, required — The field name.
          - `type` 'STRING' | 'INT32', required — The field type for reference table schema fields.
        - `primary_keys` string[], required — 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.
      - `source` 'LOCAL_FILE' | 'S3' | 'GCS' | 'AZURE', required — The source type for creating reference table data. Only these source types can be created through this API.
      - `table_name` string, required — Name to identify this reference table.
      - `tags` string[] — Tags for organizing and filtering reference tables.
    - `type` 'reference_table', required — Reference table resource type.

## Response `201`

Created

- TableResultV2 — A reference table resource containing its full configuration and state.
  - `data` TableResultV2Data — The data object containing the reference table configuration and state.
    - `attributes` TableResultV2DataAttributes — Attributes that define the reference table's configuration and properties.
      - `created_by` string — UUID of the user who created the reference table.
      - `description` string — Optional text describing the purpose or contents of this reference table.
      - `file_metadata` TableResultV2DataAttributesFileMetadata — Metadata specifying where and how to access the reference table's data file. For cloud storage tables (S3/GCS/Azure): - sync_enabled and access_details will always be present - error fields (error_message, error_row_count, error_type) are present only when errors occur For local file tables: - error fields (error_message, error_row_count) are present only when errors occur - sync_enabled, access_details are never present
        - `access_details` TableResultV2DataAttributesFileMetadataOneOfAccessDetails — Cloud storage access configuration for the reference table data file.
          - `aws_detail` TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail — Amazon Web Services S3 storage access configuration.
            - `aws_account_id` string — AWS account ID where the S3 bucket is located.
            - `aws_bucket_name` string — S3 bucket containing the CSV file.
            - `file_path` string — The relative file path from the S3 bucket root to the CSV file.
          - `azure_detail` TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail — Azure Blob Storage access configuration.
            - `azure_client_id` string — Azure service principal (application) client ID with permissions to read from the container.
            - `azure_container_name` string — Azure Blob Storage container containing the CSV file.
            - `azure_storage_account_name` string — Azure storage account where the container is located.
            - `azure_tenant_id` string — Azure Active Directory tenant ID.
            - `file_path` string — The relative file path from the Azure container root to the CSV file.
          - `gcp_detail` TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail — Google Cloud Platform storage access configuration.
            - `file_path` string — The relative file path from the GCS bucket root to the CSV file.
            - `gcp_bucket_name` string — GCP bucket containing the CSV file.
            - `gcp_project_id` string — GCP project ID where the bucket is located.
            - `gcp_service_account_email` string — Service account email with read permissions for the GCS bucket.
        - `error_message` string — The error message returned from the last operation (sync for cloud storage, upload for local file).
        - `error_row_count` integer — The number of rows that failed to process.
        - `error_type` 'TABLE_SCHEMA_ERROR' | 'FILE_FORMAT_ERROR' | 'CONFIGURATION_ERROR' | 'QUOTA_EXCEEDED' | 'CONFLICT_ERROR' | 'VALIDATION_ERROR' | 'STATE_ERROR' | 'OPERATION_ERROR' | 'SYSTEM_ERROR' — The type of error that occurred during file processing. This field provides high-level error categories for easier troubleshooting and is only present when there are errors.
        - `sync_enabled` boolean — Whether this table is synced automatically from cloud storage. Only applicable for cloud storage sources.
      - `last_updated_by` string — UUID of the user who last updated the reference table.
      - `row_count` integer — The number of successfully processed rows in the reference table.
      - `schema` TableResultV2DataAttributesSchema — Schema defining the structure and columns of the reference table.
        - `fields` TableResultV2DataAttributesSchemaFieldsItems[], required — The schema fields.
          - `name` string, required — The field name.
          - `type` 'STRING' | 'INT32', required — The field type for reference table schema fields.
        - `primary_keys` string[], required — 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.
      - `source` 'LOCAL_FILE' | 'S3' | 'GCS' | 'AZURE' | 'SERVICENOW' | 'SALESFORCE' | 'DATABRICKS' | 'SNOWFLAKE' — The source type for reference table data. Includes all possible source types that can appear in responses.
      - `status` string — The processing status of the table.
      - `table_name` string — Unique name to identify this reference table. Used in enrichment processors and API calls.
      - `tags` string[] — Tags for organizing and filtering reference tables.
      - `updated_at` string — When the reference table was last updated, in ISO 8601 format.
    - `id` string — Unique identifier for the reference table.
    - `type` 'reference_table', required — Reference table resource type.

## Other responses

- `400` — Bad Request
- `403` — Forbidden
- `429` — Too many requests

---

[API](https://skmtc.net/datadog/apis/api-v2.md) · [All operations](https://skmtc.net/datadog/apis/api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/datadog/api-v2/versions/da68bf029e4c/schema)
