Skip to main content
Use the Files API to upload files to Kintone and download files attached to records. File fields in records reference files by a fileKey string — upload a file first to get a fileKey, then use that key when adding or updating a record.

Endpoint summary

APIMethodURL
Download FileGET/k/v1/file.json
Upload FilePOST/k/v1/file.json

Download file

Downloads a file from Kintone. The fileKey for a file is returned in the record’s file field value when you retrieve a record.Request parameters
ParameterTypeRequiredDescription
fileKeyStringYesThe file key of the file to download. Obtain this from the file field value of a record.
ResponseThe response body is the raw binary content of the file. The Content-Type header reflects the file’s MIME type.
The fileKey is tied to the specific attachment on a specific record. Retrieve it from the record’s file field using Get Record before calling this endpoint.
curl -X GET 'https://{subdomain}.kintone.com/k/v1/file.json?fileKey={fileKey}' \
  -H 'X-Cybozu-API-Token: {APIToken}' \
  -o downloaded-file.pdf
Getting a fileKey from a recordFile field values in a record contain an array of attachment objects. Each attachment has a fileKey property:
{
  "record": {
    "attachment": {
      "type": "FILE",
      "value": [
        {
          "contentType": "application/pdf",
          "fileKey": "202cb962ac59075b964b07152d234b70",
          "name": "report.pdf",
          "size": "204800"
        }
      ]
    }
  }
}

Upload file

Uploads a file to Kintone and returns a fileKey. Use the fileKey when setting a file field value in Add Record or Update Record.Request
PropertyValue
Content-Typemultipart/form-data
Form parameters
ParameterTypeRequiredDescription
fileBinaryYesThe file to upload. Include the file content, filename, and MIME type in the multipart form data.
Response parameters
ParameterTypeDescription
fileKeyStringA temporary file key that represents the uploaded file. Use this key when setting a file field value on a record.
An uploaded file’s fileKey expires if it is not attached to a record within 3 days. Upload files immediately before creating or updating records.
curl -X POST 'https://{subdomain}.kintone.com/k/v1/file.json' \
  -H 'X-Cybozu-API-Token: {APIToken}' \
  -F 'file=@/path/to/your/file.pdf;type=application/pdf'
Sample response
{
  "fileKey": "c15b3870-7505-4ab6-9d8d-b9bdbc74f5d6"
}

Attaching an uploaded file to a record

After uploading, pass the returned fileKey in the file field value when creating or updating a record:
curl
# Step 1: Upload the file
curl -X POST 'https://{subdomain}.kintone.com/k/v1/file.json' \
  -H 'X-Cybozu-API-Token: {APIToken}' \
  -F '[email protected];type=application/pdf'
# Response: { "fileKey": "c15b3870-7505-4ab6-9d8d-b9bdbc74f5d6" }

# Step 2: Attach the fileKey to a record field
curl -X POST 'https://{subdomain}.kintone.com/k/v1/record.json' \
  -H 'X-Cybozu-API-Token: {APIToken}' \
  -H 'Content-Type: application/json' \
  -d '{
    "app": 1,
    "record": {
      "title": { "value": "Q4 Report" },
      "attachment": {
        "value": [
          { "fileKey": "c15b3870-7505-4ab6-9d8d-b9bdbc74f5d6" }
        ]
      }
    }
  }'

  • Records — Add and update records, including file field values.
  • Bulk requests — Combine file-related record operations.

Build docs developers (and LLMs) love