Authentication
You can use the API to export and import both the newest and the first versions of codebooks.
Authenticate with a personal API key sent as Authorization: Bearer dtp_… on every request. Create the key under My profile → API keys with the scope Database · View for export or Database · Edit for import; see Managing API keys. The key acts as you, so you also need access to the database itself.
Since DataTile 26.11 (November 2026) the token from the Profile page and the token header no longer work. A request that still uses them is rejected with 401 "The API key is invalid".
For export, you will need the database identifier hash.
Codebook V.2
You can export a codebook from an existing database by calling the following endpoints:
GET /api/v2/projects/{db_hash}/api/codebook/export-v2/
To import a codebook, get ready with an Excel file and use
POST /api/v2/projects/{projectId}/api/codebook/import-v2/
For Codbook v.2, export in JSON format is also available:
GET /api/v2/projects/{db_hash}/api/codebook/export-v2/json
Import from JSON is not possible at the time.
Codebook V.1
You can download codebooks from an existing database by calling the following endpoints:
GET /api/v2/projects/{db_hash}/api/codebook/export
This one will download an optimized version of the codebook. DataTile will try to detect naming patterns in the database schema and generate an optimized codebook with ARR notation.
GET /api/v2/projects/{db_hash}/api/codebook/export-lab
POST an Excel file as mime/multipart to the following endpoint
POST /api/v2/projects/{projectId}/api/codebook/import