EMPTY_CODEBOOK — No codebook on this question
Summary
Section titled “Summary”You’re trying to use a question’s codebook in an operation that requires one (cloning, coding with an explicit codebook reference, exporting the codebook), but the question doesn’t have a codebook yet.
HTTP status
Section titled “HTTP status”422 Unprocessable Entity. Standard envelope.
Example response
Section titled “Example response”{ "success": false, "error": { "code": "EMPTY_CODEBOOK", "message": "Source question q_01HXJZK... has no codebook to clone from.", "request_id": "req_01HXJZK4ABCDEF", "doc_url": "https://docs.surveycoder.io/errors/empty-codebook" }}Why this happens
Section titled “Why this happens”- Cloning a codebook from a fresh question.
- Calling
POST /v1/codewithcodebook_ref: { question_id: '...' }pointing at a question that hasn’t been processed. - Exporting a codebook that doesn’t exist yet.
How to fix it
Section titled “How to fix it”- Generate the codebook first:
POST /v1/codebook/generatewith the source question’s ID. - Or run the one-call
POST /v1/codeon the source question — it generates the codebook in stage 2 as part of the same call. - Once
has_codebook: trueon the source, retry the clone/reference.
Related
Section titled “Related”INVALID_STATE- Coding pipeline — codebook generation is stage 2