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.readon the library.
Path parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
projectid | string | Yes | - | The project id. |
Query parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
docid | string | Yes | - | 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.