List All Files

GET

/v1/files

Returns a paginated list of files.


Filter parameters

variant_id

Return only files associated with the variant with this ID.


curl "https://api.lemonsqueezy.com/v1/files" \
  -H 'Accept: application/vnd.api+json' \
  -H 'Content-Type: application/vnd.api+json' \
  -H 'Authorization: Bearer {api_key}'
curl "https://api.lemonsqueezy.com/v1/files?filter[variant_id]=8" \
  -H 'Accept: application/vnd.api+json'  \
  -H 'Content-Type: application/vnd.api+json' \
  -H 'Authorization: Bearer {api_key}'

Returns

Returns a paginated list of File objects.

{
  "meta": {
    "page": {
      "currentPage": 1,
      "from": 1,
      "lastPage": 1,
      "perPage": 10,
      "to": 10,
      "total": 10
    }
  },
  "jsonapi": {
    "version": "1.0"
  },
  "links": {
    "first": "https://api.lemonsqueezy.com/v1/files?page%5Bnumber%5D=1&page%5Bsize%5D=10&sort=sort",
    "last": "https://api.lemonsqueezy.com/v1/files?page%5Bnumber%5D=1&page%5Bsize%5D=10&sort=sort"
  },
  "data": [
    {
      "type": "files",
      "id": "1",
      "attributes": {
        "variant_id": 168,
        "identifier": "6dce5ba7-76f2-481f-ad1e-9c2bec6eb0e2",
        "name": "lemonade.zip",
        "extension": "zip",
        "download_url": "https://app.lemonsqueezy.com/download/6dce5ba7-76f2-481f-ad1e-9c2bec6eb0e2?expires=1636383388&signature=886a63faf7215c54011accfa08578b1b687def66f767092629f263061b3a253a",
        "size": 874694,
        "size_formatted": "854 KB",
        "version": "1.0.0",
        "sort": 1,
        "status": "published",
        "createdAt": "2021-11-05T10:22:14.000000Z",
        "updatedAt": "2021-11-05T16:16:33.000000Z",
        "test_mode": false
      },
      "relationships": {
        "variant": {
          "links": {
            "related": "https://api.lemonsqueezy.com/v1/files/1/variant",
            "self": "https://api.lemonsqueezy.com/v1/files/1/relationships/variant"
          }
        }
      },
      "links": {
        "self": "https://api.lemonsqueezy.com/v1/files/1"
      }
    },
    {...},
    {...},
  ]
}

Was this page helpful?