---
updatedAt: 2026-07-22T13:13:02.000Z
agentTools:
  projectIndex: https://developer.doit.com/llms.txt
---

# Create dataset

Creates a new DataHub dataset. A dataset is a logical grouping of events that share the same provider name. Creating a dataset allows you to define metadata such as name and description before ingesting events.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "DoiT Cloud Intelligence",
    "description": "Programmatic access to DoiT Platform",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api.doit.com"
    }
  ],
  "security": [
    {
      "api_key": []
    },
    {
      "tenantId": [],
      "api_key": []
    }
  ],
  "tags": [
    {
      "name": "DataHub",
      "description": "Ingest third-party cost, usage, and metric-based data for analysis."
    }
  ],
  "paths": {
    "/datahub/v1/datasets": {
      "post": {
        "tags": [
          "DataHub"
        ],
        "summary": "Create dataset",
        "description": "Creates a new DataHub dataset. A dataset is a logical grouping of events that share the same provider name. Creating a dataset allows you to define metadata such as name and description before ingesting events.",
        "operationId": "createDatahubDataset",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The name of the dataset. Allowed characters: alphanumeric (0-9,a-z,A-Z), underscore (_), dash (-), and spaces between words.",
                    "example": "My Custom Dataset",
                    "pattern": "^[a-zA-Z0-9_-]+( [a-zA-Z0-9_-]+)*$"
                  },
                  "description": {
                    "type": "string",
                    "description": "An optional description for the dataset.",
                    "example": "Dataset for tracking custom business metrics"
                  },
                  "displayName": {
                    "type": "string",
                    "description": "Optional human-readable name shown in the DoiT console and in report results instead of `name`. 1-64 characters after trimming; must not be unique. Ingest always uses `name`.",
                    "example": "Datadog (prod)",
                    "maxLength": 64
                  },
                  "logoName": {
                    "type": "string",
                    "description": "An optional preset logo shown next to the dataset in the DoiT console.",
                    "example": "litellm",
                    "enum": [
                      "anthropic",
                      "atlassian",
                      "aws",
                      "azure",
                      "bifrost",
                      "chatgpt",
                      "cloudflare",
                      "copilot",
                      "figma",
                      "gcp",
                      "github",
                      "gitlab",
                      "hotjar",
                      "jira",
                      "litellm",
                      "miro",
                      "notion",
                      "slack",
                      "wordpress"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created - Dataset created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "description": "The name of the dataset.",
                      "example": "My Custom Dataset"
                    },
                    "description": {
                      "type": "string",
                      "description": "The description of the dataset.",
                      "example": "Dataset for tracking custom business metrics"
                    },
                    "records": {
                      "type": "integer",
                      "format": "int64",
                      "description": "The number of records in the dataset.",
                      "example": null,
                      "nullable": true
                    },
                    "updatedBy": {
                      "type": "string",
                      "description": "The email of the user who last updated the dataset.",
                      "example": "user@example.com"
                    },
                    "lastUpdated": {
                      "type": "string",
                      "description": "The timestamp of the last update.",
                      "example": "2024-03-10T23:00:00Z"
                    },
                    "displayName": {
                      "type": "string",
                      "description": "Human-readable name shown in the DoiT console and in report results instead of `name`. Absent when the dataset is displayed by its `name`. Does not affect ingest, which always uses `name` as the provider.",
                      "example": "Datadog (prod)"
                    },
                    "logoName": {
                      "type": "string",
                      "description": "The preset logo shown next to the dataset in the DoiT console. Absent when the dataset has no preset logo.",
                      "example": "litellm"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "500": {
            "$ref": "#/components/responses/500"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "description": "Standard error response structure.",
        "properties": {
          "error": {
            "type": "string",
            "description": "Detailed error message."
          }
        },
        "example": {
          "error": "The request could not be completed."
        }
      }
    },
    "responses": {
      "400": {
        "description": "Bad Request - The server cannot process the request, often due to a malformed request.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "401": {
        "description": "Unauthorized - Invalid API key.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "403": {
        "description": "Forbidden - The client is not authorized to perform the request.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error - Something went wrong with the DoiT API server.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "name": "Authorization",
        "description": "Use the \"Bearer <API_KEY>\" format or sign in for autofill",
        "in": "header"
      },
      "tenantId": {
        "type": "apiKey",
        "name": "X-Tenant-Id",
        "description": "Customer (tenant) ID for the request. Separate from your API token: always authenticate with `Authorization: Bearer <token>` (personal or service account). See [Get Started](https://developer.doit.com/docs/start). Omit when your token is scoped to a single customer (resolved automatically). A service account can select an active direct or nested descendant of its home customer; the endpoint's normal permissions, entitlements, and resource-ownership checks still apply. A service-account target outside that customer subtree returns `403 Forbidden`. Prefer this header over the legacy `customerContext` query parameter, which only applies to legacy API keys and is ignored by personal and service account tokens.",
        "in": "header"
      }
    }
  },
  "x-samples-languages": [
    "curl",
    "go",
    "node",
    "python"
  ],
  "x-cli-config": {
    "security": "oauth2",
    "params": {
      "client_id": "cli"
    }
  }
}
```