Clone a codebook between two questions in the same project
POST
/v2/codebook/clone
const url = 'https://api.surveycoder.io/v2/codebook/clone';const options = { method: 'POST', headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'}, body: '{"project_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","source_question_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","target_question_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.surveycoder.io/v2/codebook/clone \ --header 'Content-Type: application/json' \ --header 'x-api-key: <x-api-key>' \ --data '{ "project_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "source_question_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "target_question_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'Clones the categories + codes from one question to another within the
same project. Cross-project clones are not supported today — both
questions must share the same project_id. Existing codebook on the
target question is replaced.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
project_id
required
string format: uuid
source_question_id
required
string format: uuid
target_question_id
required
string format: uuid
Example generated
{ "project_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "source_question_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "target_question_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}Responses
Section titled “ Responses ”Codebook cloned