---
updatedAt: 2026-04-21T21:34:05.000Z
agentTools:
  projectIndex: https://docs.oneschema.co/llms.txt
---

# Set header row on an embed file

Set the header row either automatically or by index on an embed file. An embed must be in the `uploaded` state to enable setting headers, and an embed is returned in one of the following states: `headers_set` or `columns_mapped`.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Importer Embeds",
    "version": "1",
    "contact": {
      "name": "OneSchema Support",
      "email": "support@oneschema.co"
    },
    "license": {
      "name": "proprietary",
      "url": "https://www.oneschema.co/terms-and-conditions"
    },
    "termsOfService": "https://www.oneschema.co/terms-and-conditions",
    "description": "An API for managing OneSchema Importer Embeds, including headless importer operations and embed events."
  },
  "tags": [
    {
      "name": "Headless Importer",
      "description": "Headless Importer operations"
    }
  ],
  "paths": {
    "/v1/embeds/{embed_id}/set-header": {
      "post": {
        "operationId": "set-header-row-on-an-embed-file",
        "summary": "Set header row on an embed file",
        "description": "Set the header row either automatically or by index on an embed file. An embed must be in the `uploaded` state to enable setting headers, and an embed is returned in one of the following states: `headers_set` or `columns_mapped`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/EmbedIdPath"
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbedDetail"
                }
              }
            }
          },
          "422": {
            "description": "422",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/empty-response"
                }
              }
            }
          }
        },
        "tags": [
          "Headless Importer"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetHeaderRequest"
              }
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "components": {
    "parameters": {
      "EmbedIdPath": {
        "name": "embed_id",
        "in": "path",
        "required": true,
        "description": "The id of the embed which contains the file.",
        "schema": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "schemas": {
      "EmbedColumn": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "examples": [
              227897
            ],
            "default": 0
          },
          "name": {
            "type": "string",
            "examples": [
              "DD/MM/YYYY"
            ]
          },
          "template_column_key": {
            "type": "string",
            "examples": [
              "ddmmyyyy"
            ]
          },
          "is_custom": {
            "type": "boolean",
            "examples": [
              false
            ],
            "default": true
          }
        }
      },
      "EmbedDetail": {
        "type": "object",
        "properties": {
          "columns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmbedColumn"
            }
          }
        },
        "allOf": [
          {
            "$ref": "#/components/schemas/EmbedSummary"
          }
        ]
      },
      "EmbedSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "examples": [
              41559
            ],
            "default": 0
          },
          "token": {
            "type": "string",
            "examples": [
              "5fd6a161-86f1-4514-9e92-0660e19ad5c2"
            ]
          },
          "template_key": {
            "type": "string",
            "examples": [
              "employees"
            ]
          },
          "status": {
            "type": "string",
            "examples": [
              "columns_mapped"
            ]
          },
          "user_jwt": {
            "type": "string",
            "examples": [
              "REPLACE_WITH_JWT"
            ]
          },
          "imported_row_count": {
            "type": "integer",
            "description": "Total number of imported rows. Only present when the embed status is \"imported\".",
            "examples": [
              995
            ]
          }
        }
      },
      "SetHeaderRequest": {
        "type": "object",
        "required": [
          "index"
        ],
        "properties": {
          "index": {
            "oneOf": [
              {
                "type": "integer",
                "format": "int32"
              },
              {
                "type": "string",
                "enum": [
                  "auto"
                ]
              }
            ],
            "description": "Set to the 0-based index of the header row, or \"auto\" to automatically detect and set the header row."
          }
        }
      },
      "empty-response": {
        "type": "object",
        "properties": {}
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-KEY"
      }
    }
  },
  "servers": [
    {
      "url": "https://api.oneschema.co",
      "description": "Production server (hosted in the US)",
      "variables": {}
    },
    {
      "url": "https://api.eu.oneschema.co",
      "description": "Production server (hosted in the EU)",
      "variables": {}
    },
    {
      "url": "https://api.ca.oneschema.co",
      "description": "Production server (hosted in Canada)",
      "variables": {}
    },
    {
      "url": "https://api.au.oneschema.co",
      "description": "Production server (hosted in Australia)",
      "variables": {}
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```