---
title: "Get a Codebook by its key"
method: GET
path: "/Codebooks/{codebookKey}"
tags: ["Codebooks"]
---

# Get a Codebook by its key

`GET /Codebooks/{codebookKey}`

Each Question has exactly one Codebook, which may be shared across multiple Questions.

A Codebook is tree-structured, where the leaf nodes are Codes and non-leaf nodes are Nets.  Only Codes may be used to code a Response.


This resource can return the Codes in the Codebook as a flattened list containing only the Codes, or as a tree with the full structure of the Codebook.

## Path parameters

- `codebookKey` integer, required

## Query parameters

- `tree` boolean

## Response `200`

OK

- GetCodebookResponse — Contains a presentation of codebook
  - `errorMessage` string, nullable
  - `codebookKey` integer — The key of the Codebook.
  - `codebook` CodeOrNet[], nullable — The Codes in the Codebook, in the order they appear in the Codebook. Codebooks are tree structured and may be of any depth, although a depth of more than 6 is rare. Only the leaf nodes may be applied to a response. These leaf nodes are Codes. Nets have child codes or nets. Nets may not be used to code a response. They serve to provide structure to the Codebook. Nets typically represent groups of related codes.
    - `key` integer, required — The key of the Code. This key is used to relate a coded response to its Code in the Codebook.
    - `description` string, required — The description of the Code. This description represents the concept expressed in the coded Response.
    - `inputId` string, nullable — A optional identifier which may be used during automatic coding of responses. If null this field will not be present in the response.
    - `outputId` string, nullable — A optional identifier which may be used to identify the code in tabulation software. If null this field will not be present in the response.
    - `regexPattern` string, nullable — Optional regular expression pattern which may be used for assisting human coders or for automatic coding.
    - `color` string, nullable — An optional color for the code in CSS hexadecimal six digit format, e.g. #FF0000 for red. If the code color is the default value of #000000 (black) this field will not be present in the response.
    - `children` CodeOrNet[], nullable — The children of a Net. When querying for a codebook, this field will be present in the response only for Nets, and will never be present when the Codebook is requested with the tree=false parameter. The children are listed in the order they appear in the Codebook.

---

[API](https://skmtc.net/voxco/apis/acuity-webapi-1-0.md) · [All operations](https://skmtc.net/voxco/apis/acuity-webapi-1-0/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/voxco/acuity-webapi-1-0/revisions/2ea4b8555197/schema)
