Manage projects and library content

Create or clone an asset

When cloning an asset, you must provide:

  • the name (as a string),
  • the clone_from (the uid representing the asset),
  • the asset_type

Where asset_type must be one of these values:

  • block (can be cloned to block, question, survey, template)
  • question (can be cloned to question, survey, template)
  • survey (can be cloned to block, question, survey, template)
  • template (can be cloned to survey, template)

Settings are cloned only when type of assets are survey or template. In that case, share-metadata is not preserved.

When creating a new block or question asset, settings are not saved either.

post/api/v2/assets/

Request

  • The document declares no server URL.
  • Auth: one of:
    • HTTP basic
    • API key in header Authorization

Request body

OR

Response

urlstring uri required
ownerstring uri required
owner__usernamestring required

Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.

parentstring uri nullable
asset_type'text' | 'empty' | 'question' | 'block' | 'survey' | 'template' | 'collection' required
  • text - text
  • empty - empty
  • question - question
  • block - block
  • survey - survey
  • template - template
  • collection - collection
date_createdstring date-time
date_modifiedstring date-time
date_deployedstring date-time nullable
version_idstring nullable required
version__content_hashstring nullable required
version_countinteger required
has_deploymentboolean required
deployed_version_idstring nullable required
deployment__linksobject required
deployment__activeboolean required
deployment__submission_countinteger required
deployment__last_submission_timestring date-time nullable required
deployment__encryptedboolean required
deployment__uuidstring nullable required
deployment_status'archived' | 'deployed' | 'draft' | '-' required
  • archived - Archived
  • deployed - Deployed
  • draft - Draft
  • - - -
report_customobject
map_customobject
xform_linkstring uri required
hooks_linkstring uri required
tag_stringstring
uidstring required
kindstring required
xls_linkstring uri required
namestring
exportsstring uri required
datastring uri required
subscribers_countinteger required
statusstring required
access_typesstring[] nullable required
paired_datastring uri required
project_ownershipobject nullable required
owner_labelstring required
last_modified_bystring nullable required
created_bystring nullable required

Example response

{
  "url": "https://kf.kobotoolbox.org/api/v2/assets/aBeA23YCYjkGTFvYVHuAyU/",
  "owner": "https://kf.kobotoolbox.org/api/v2/users/bob/",
  "parent": "https://kf.kobotoolbox.org/api/v2/assets/a3C9wWefqZVkChNLKqqXVZ/",
  "deployed_versions": {
    "results": [
      {
        "url": "https://kf.kobotoolbox.org/api/v2/assets/aBeA23YCYjkGTFvYVHuAyU/versions/vBeA23YCYjkGTFvYVHuAyU/"
      }
    ]
  },
  "xform_link": "https://kf.kobotoolbox.org/api/v2/assets/aBeA23YCYjkGTFvYVHuAyU/xform/",
  "hooks_link": "https://kf.kobotoolbox.org/api/v2/assets/aBeA23YCYjkGTFvYVHuAyU/hooks/",
  "xls_link": "https://kf.kobotoolbox.org/api/v2/assets/aBeA23YCYjkGTFvYVHuAyU.xls",
  "exports": "https://kf.kobotoolbox.org/api/v2/assets/aBeA23YCYjkGTFvYVHuAyU/exports/",
  "data": "https://kf.kobotoolbox.org/api/v2/assets/aBeA23YCYjkGTFvYVHuAyU/data/",
  "paired_data": "https://kf.kobotoolbox.org/api/v2/assets/aBeA23YCYjkGTFvYVHuAyU/paired-data/"
}

Changes

    • breaking

      the response property // became nullable for the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status