Skip to main content

Read a CSV header

GET /projects/:projectid/databases/csv-header

The column names in a library CSV.

Reads just the header row of a CSV in the library, so you can build a column mapping before starting an import.

Authentication

  • Project API key: The credential for everything external. Created in Project Settings, bound to one project, and limited to the scopes it was granted. Format: proj.<keyId>.<secret>.
  • Required permission: library.read on the library.

Path parameters

NameTypeRequiredDefaultDescription
projectidstringYes-The project id.

Query parameters

NameTypeRequiredDefaultDescription
docidstringYes-The library file id of the CSV.

Example request

curl -X GET \
-H "Authorization: proj.KEY_ID.SECRET" \
{{BASE_URL}}/projects/{{PROJECT_ID}}/databases/csv-header?docid=FILE_ID

Responses

200

The CSV's header row.

{
"headers": [
"customer",
"total"
]
}

400

docid was missing.

Notes

  • This reads a library file rather than a database, so it is gated on library read.