---
title: Create download token
slug: document-api/create-download-token
docTags: 
createdAt: 2025-10-20T09:39:14.635Z
---

{
  "id": "skRqxxQz0Z-tJ6u6pF5gP",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.catenda.com/v2/projects/{project-id}/libraries/{library-id}/items/{library-item-id}/revisions/{library-item-revision-id}/token",
    "servers": [
      {
        "url": "https://api.catenda.com/v2/projects/{project-id}/libraries/{library-id}/items/{library-item-id}/revisions/{library-item-revision-id}/token"
      }
    ],
    "name": "Create download token",
    "description": "<p>Create a signed download URL token to allow access to the document revision without requiring additional authentication.</p>\n<p>The token will expire in one hour.</p>\n<p>Supported library types are <strong>document</strong>.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "project-id",
          "type": "string",
          "example": "af2d8af0fa54465b89bf26dd3d92cfd0",
          "description": "Catenda project id"
        },
        {
          "kind": "required",
          "name": "library-id",
          "type": "string",
          "description": "Id of the library"
        },
        {
          "kind": "required",
          "name": "library-item-id",
          "type": "string",
          "description": "Id of the library item"
        },
        {
          "kind": "required",
          "name": "library-item-revision-id",
          "type": "string",
          "description": "Id of the library item revision"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "format",
          "type": "string",
          "description": "Optionally specify an alternative format when download a library item."
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "Bearer",
          "name": "Bearer",
          "kind": "optional",
          "type": "http",
          "scheme": "bearer"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "library-item-document-token",
            "schema": [
              {
                "name": "token",
                "kind": "optional",
                "type": "string",
                "description": "<p>The token value, valid for one hour.</p>",
                "example": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpdGVtLWlkIjoiZTc3NjU5YjliZTQzNDhkZDg1NjZiMWU3YmIwYmZkZjgiLCJsaWJyYXJ5LWlkIjoiNzZhZDFhYThjNmNiNDE1YTgxZTE0ZGVkNGU2M2Y3ZmUiLCJ1c2VyLWlkIjoiMjU1NGJiZDctMDkxZC00ZWVjLWIzMTMtOTI5OGZlNDE4YjQ5IiwidHlwZSI6ImxpYnJhcnktaXRlbSIsInByb2plY3QtaWQiOiIyYTA4OGJjZC0wOGZhLTQzOGEtODI1MS0yZDkxYjlhNTk3YTIiLCJjbGllbnQtaWQiOiI1bVBESFh6NFNJRHJ3VmYiLCJleHAiOjF3MTM5NzQ3NDF9.MJ67ENsOItZJybEYt7Yjes7AkWRuUXrT8_eWvQk5w98"
              },
              {
                "name": "url",
                "kind": "optional",
                "type": "string",
                "description": "A time limited URL to download the document.",
                "example": "https://api.catenda.com/v2/download?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpdGVtLWlkIjoiZTc3NjU5YjliZTQzNDhkZDg1NjZiMWU3YmIwYmZkZjgiLCJsaWJyYXJ5LWlkIjoiNzZhZDFhYThjNkNiNDE1YTgxZTE0ZGVkNGU2M2Y3ZmUiLCJ1c2VyLWlkIjoiMjU1NGJiZDctMDkxZC00ZWVjLWIzMTMtOTI5OGZlNDE4YjQ5IiwidHlwZSI6ImxpYnJhcnktaXRlbSIsInByb2plY3QtaWQiOiIyYTA4OGJjZC0wOGZhLTQzOGEtODI1MS0yZDkxYjlhNTk3YTIiLCJjbGllbnQtaWQiOiI1bVBESFh6NFNJRHJ3VmYiLCJleHAiOjE3MTM5NzQ3NDF9.MJ67ENsOItZJybEYt7Yjes7AkWRuUXrT8_eWvQk5w98"
              }
            ],
            "modelRef": "#/components/schemas/library-item-document-token",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "hTKIoM-m61lKI99Z7vrHB",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.catenda.com/v2/projects/{project-id}/libraries/{library-id}/items/{library-item-id}/revisions/{library-item-revision-id}/token \\\n     --header 'accept: application/json'"
        },
        {
          "id": "h19QDIDRgbKxkGANw98Jm",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.catenda.com/v2/projects/{project-id}/libraries/{library-id}/items/{library-item-id}/revisions/{library-item-revision-id}/token\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "aJeO04u5wK0tkP2z1h0By",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.catenda.com/v2/projects/{project-id}/libraries/{library-id}/items/{library-item-id}/revisions/{library-item-revision-id}/token\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "midWKxt5LDcLNvDUtBJu_",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.catenda.com/v2/projects/{project-id}/libraries/{library-id}/items/{library-item-id}/revisions/{library-item-revision-id}/token\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "hTKIoM-m61lKI99Z7vrHB"
    },
    "results": {
      "languages": [
        {
          "id": "BhdQunaTXo3sEyckjnyM0",
          "language": "200",
          "code": "// OK\n{\n  \"token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpdGVtLWlkIjoiZTc3NjU5YjliZTQzNDhkZDg1NjZiMWU3YmIwYmZkZjgiLCJsaWJyYXJ5LWlkIjoiNzZhZDFhYThjNmNiNDE1YTgxZTE0ZGVkNGU2M2Y3ZmUiLCJ1c2VyLWlkIjoiMjU1NGJiZDctMDkxZC00ZWVjLWIzMTMtOTI5OGZlNDE4YjQ5IiwidHlwZSI6ImxpYnJhcnktaXRlbSIsInByb2plY3QtaWQiOiIyYTA4OGJjZC0wOGZhLTQzOGEtODI1MS0yZDkxYjlhNTk3YTIiLCJjbGllbnQtaWQiOiI1bVBESFh6NFNJRHJ3VmYiLCJleHAiOjF3MTM5NzQ3NDF9.MJ67ENsOItZJybEYt7Yjes7AkWRuUXrT8_eWvQk5w98\",\n  \"url\": \"https://api.catenda.com/v2/download?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpdGVtLWlkIjoiZTc3NjU5YjliZTQzNDhkZDg1NjZiMWU3YmIwYmZkZjgiLCJsaWJyYXJ5LWlkIjoiNzZhZDFhYThjNkNiNDE1YTgxZTE0ZGVkNGU2M2Y3ZmUiLCJ1c2VyLWlkIjoiMjU1NGJiZDctMDkxZC00ZWVjLWIzMTMtOTI5OGZlNDE4YjQ5IiwidHlwZSI6ImxpYnJhcnktaXRlbSIsInByb2plY3QtaWQiOiIyYTA4OGJjZC0wOGZhLTQzOGEtODI1MS0yZDkxYjlhNTk3YTIiLCJjbGllbnQtaWQiOiI1bVBESFh6NFNJRHJ3VmYiLCJleHAiOjE3MTM5NzQ3NDF9.MJ67ENsOItZJybEYt7Yjes7AkWRuUXrT8_eWvQk5w98\"\n}"
        }
      ],
      "selectedLanguageId": "BhdQunaTXo3sEyckjnyM0"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}