Skip to content

EMPTY_CODEBOOK — No codebook on this question

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.

422 Unprocessable Entity. Standard envelope.

{
"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"
}
}
  • Cloning a codebook from a fresh question.
  • Calling POST /v1/code with codebook_ref: { question_id: '...' } pointing at a question that hasn’t been processed.
  • Exporting a codebook that doesn’t exist yet.
  1. Generate the codebook first: POST /v1/codebook/generate with the source question’s ID.
  2. Or run the one-call POST /v1/code on the source question — it generates the codebook in stage 2 as part of the same call.
  3. Once has_codebook: true on the source, retry the clone/reference.