Skip to content
POST/api/v1/data-cards

Create a Data Card

Creates a Data Card for a dataset. Used for EU AI Act + GDPR documentation requirements.

Authentication

Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/api-keys.

Request body required

Example

{
  "projectId": "00000000-0000-0000-0000-000000000000",
  "datasetId": "00000000-0000-0000-0000-000000000000",
  "metadata": {
    "name": "string",
    "version": "string",
    "description": "string",
    "intendedUse": "string",
    "license": "mit",
    "accessLevel": "public",
    "records": 0,
    "sizeBytes": 0,
    "format": "csv",
    "schema": [
      {
        "name": "string",
        "type": "string",
        "description": "string",
        "nullable": false,
        "pii": false,
        "sensitive": false
      }
    ],
    "splits": [
      {
        "name": "string",
        "records": 0,
        "percentage": 0,
        "stratified": false,
        "stratificationKey": "string"
      }
    ],
    "labelDistribution": {},
    "source": "string",
    "collectionMethod": "scraped",
    "languages": [
      "string"
    ],
    "geographicCoverage": [
      "string"
    ]
  },
  "name": "string",
  "version": "string",
  "motivation": "string",
  "composition": {},
  "collectionMethod": {},
  "preprocessing": {},
  "ethicalConsiderations": {},
  "maintenancePlan": {}
}
Schema
{
  "application/json": {
    "schema": {
      "type": "object",
      "properties": {
        "projectId": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "datasetId": {
          "nullable": true,
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "metadata": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            },
            "version": {
              "type": "string",
              "maxLength": 60
            },
            "description": {
              "type": "string",
              "maxLength": 20000
            },
            "intendedUse": {
              "type": "string",
              "maxLength": 20000
            },
            "license": {
              "type": "string",
              "enum": [
                "mit",
                "apache2",
                "cc_by_4",
                "cc_by_sa_4",
                "cc_by_nc_4",
                "cc0",
                "proprietary",
                "custom"
              ]
            },
            "accessLevel": {
              "type": "string",
              "enum": [
                "public",
                "internal",
                "restricted",
                "confidential"
              ]
            },
            "records": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "sizeBytes": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "format": {
              "type": "string",
              "enum": [
                "csv",
                "json",
                "parquet",
                "tfrecord",
                "hdf5",
                "sql",
                "text",
                "image",
                "audio",
                "video",
                "other"
              ]
            },
            "schema": {
              "maxItems": 2000,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "type": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "nullable": {
                    "type": "boolean"
                  },
                  "pii": {
                    "type": "boolean"
                  },
                  "sensitive": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "type"
                ],
                "additionalProperties": false
              }
            },
            "splits": {
              "maxItems": 100,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "records": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "percentage": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 100
                  },
                  "stratified": {
                    "type": "boolean"
                  },
                  "stratificationKey": {
                    "type": "string",
                    "maxLength": 200
                  }
                },
                "required": [
                  "name",
                  "records",
                  "percentage"
                ],
                "additionalProperties": false
              }
            },
            "labelDistribution": {
              "type": "object",
              "additionalProperties": {
                "type": "number"
              }
            },
            "source": {
              "type": "string",
              "maxLength": 2000
            },
            "collectionMethod": {
              "type": "string",
              "enum": [
                "scraped",
                "surveyed",
                "api",
                "manual_annotation",
                "synthetic",
                "sensor",
                "crowdsourced",
                "purchased",
                "government",
                "other"
              ]
            },
            "languages": {
              "maxItems": 500,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 60
              }
            },
            "geographicCoverage": {
              "maxItems": 500,
              "type": "array",
              "items": {
                "type": "string",
                "maxLength": 120
              }
            }
          },
          "required": [
            "name"
          ],
          "additionalProperties": false
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "version": {
          "type": "string",
          "maxLength": 60
        },
        "motivation": {
          "type": "string",
          "maxLength": 20000
        },
        "composition": {
          "type": "object",
          "additionalProperties": {}
        },
        "collectionMethod": {
          "type": "object",
          "additionalProperties": {}
        },
        "preprocessing": {
          "type": "object",
          "additionalProperties": {}
        },
        "ethicalConsiderations": {
          "type": "object",
          "additionalProperties": {}
        },
        "maintenancePlan": {
          "type": "object",
          "additionalProperties": {}
        }
      },
      "required": [
        "projectId"
      ],
      "additionalProperties": false
    }
  }
}

Response

201 example

{
  "success": true
}

All status codes

201Success.
400Invalid params.
403Cross-tenant denial.

Code samples

cURL

curl -X POST \
  https://evalguard.ai/api/v1/data-cards \
  -H "Authorization: Bearer $EVALGUARD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "projectId": "00000000-0000-0000-0000-000000000000", "datasetId": "00000000-0000-0000-0000-000000000000", "metadata": { "name": "string", "version": "string", "description": "string", "intendedUse": "string", "license": "mit", "accessLevel": "public", "records": 0, "sizeBytes": 0, "format": "csv", "schema": [ { "name": "string", "type": "string", "description": "string", "nullable": false, "pii": false, "sensitive": false } ], "splits": [ { "name": "string", "records": 0, "percentage": 0, "stratified": false, "stratificationKey": "string" } ], "labelDistribution": {}, "source": "string", "collectionMethod": "scraped", "languages": [ "string" ], "geographicCoverage": [ "string" ] }, "name": "string", "version": "string", "motivation": "string", "composition": {}, "collectionMethod": {}, "preprocessing": {}, "ethicalConsiderations": {}, "maintenancePlan": {} }'

TypeScript

import { EvalGuard } from "@evalguard/sdk";

const client = new EvalGuard({ apiKey: process.env.EVALGUARD_API_KEY });

const response = await client.request({
  method: "POST",
  path: "/api/v1/data-cards",
  body: {
    "projectId": "00000000-0000-0000-0000-000000000000",
    "datasetId": "00000000-0000-0000-0000-000000000000",
    "metadata": {
      "name": "string",
      "version": "string",
      "description": "string",
      "intendedUse": "string",
      "license": "mit",
      "accessLevel": "public",
      "records": 0,
      "sizeBytes": 0,
      "format": "csv",
      "schema": [
        {
          "name": "string",
          "type": "string",
          "description": "string",
          "nullable": false,
          "pii": false,
          "sensitive": false
        }
      ],
      "splits": [
        {
          "name": "string",
          "records": 0,
          "percentage": 0,
          "stratified": false,
          "stratificationKey": "string"
        }
      ],
      "labelDistribution": {},
      "source": "string",
      "collectionMethod": "scraped",
      "languages": [
        "string"
      ],
      "geographicCoverage": [
        "string"
      ]
    },
    "name": "string",
    "version": "string",
    "motivation": "string",
    "composition": {},
    "collectionMethod": {},
    "preprocessing": {},
    "ethicalConsiderations": {},
    "maintenancePlan": {}
  },
});
console.log(response);

Python

from evalguard import EvalGuard
import os

client = EvalGuard(api_key=os.environ["EVALGUARD_API_KEY"])

response = client.request(
    method="POST",
    path="/api/v1/data-cards",
    body={
    "projectId": "00000000-0000-0000-0000-000000000000",
    "datasetId": "00000000-0000-0000-0000-000000000000",
    "metadata": {
        "name": "string",
        "version": "string",
        "description": "string",
        "intendedUse": "string",
        "license": "mit",
        "accessLevel": "public",
        "records": 0,
        "sizeBytes": 0,
        "format": "csv",
        "schema": [
            {
                "name": "string",
                "type": "string",
                "description": "string",
                "nullable": False,
                "pii": False,
                "sensitive": False
            }
        ],
        "splits": [
            {
                "name": "string",
                "records": 0,
                "percentage": 0,
                "stratified": False,
                "stratificationKey": "string"
            }
        ],
        "labelDistribution": {},
        "source": "string",
        "collectionMethod": "scraped",
        "languages": [
            "string"
        ],
        "geographicCoverage": [
            "string"
        ]
    },
    "name": "string",
    "version": "string",
    "motivation": "string",
    "composition": {},
    "collectionMethod": {},
    "preprocessing": {},
    "ethicalConsiderations": {},
    "maintenancePlan": {}
},
)
print(response)

Go

package main

import (
	"context"
	"fmt"
	"net/http"
	"os"
	"strings"
)

func main() {
	body := strings.NewReader(`{"projectId":"00000000-0000-0000-0000-000000000000","datasetId":"00000000-0000-0000-0000-000000000000","metadata":{"name":"string","version":"string","description":"string","intendedUse":"string","license":"mit","accessLevel":"public","records":0,"sizeBytes":0,"format":"csv","schema":[{"name":"string","type":"string","description":"string","nullable":false,"pii":false,"sensitive":false}],"splits":[{"name":"string","records":0,"percentage":0,"stratified":false,"stratificationKey":"string"}],"labelDistribution":{},"source":"string","collectionMethod":"scraped","languages":["string"],"geographicCoverage":["string"]},"name":"string","version":"string","motivation":"string","composition":{},"collectionMethod":{},"preprocessing":{},"ethicalConsiderations":{},"maintenancePlan":{}}`)
	req, _ := http.NewRequestWithContext(context.Background(), "POST", "https://evalguard.ai/api/v1/data-cards", body)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("EVALGUARD_API_KEY"))
	req.Header.Set("Content-Type", "application/json")
	resp, err := http.DefaultClient.Do(req)
	if err != nil { panic(err) }
	defer resp.Body.Close()
	fmt.Println(resp.Status)
}

Errors

400403

Other Compliance endpoints