Skip to main content
File Download API
curl --request GET \
  --url https://api.pazy.io/v1.0/download/:resourceType

Authentication

All requests require an API key in the request headers. Headers:
Authorization: Api-Key YOUR_API_KEY

Request

Content-Type: application/json

Path Parameters

ParameterTypeRequiredDescription
resourceTypestringYesThe resource type of the file

Query Parameters

ParameterTypeRequiredDescription
fileKeystringYesThe unique key of the file

Code Examples

curl -X GET https://api.pazy.io/v1.0/download/resource_type?fileKey=file_key \
  -H "Authorization: Api-Key YOUR_API_KEY"

Success Response

HTTP Status: 200 OK Response Fields: You will get your file as data in response.

Error Responses

Missing Resource Type

HTTP Status: 400 Bad Request
{
  "ok": false,
  "error": {
    "code": "MISSING_REQUIRED_FIELD",
    "message": "Resource Type is required"
  }
}

File Not Found

HTTP Status: 404 Not Found
{
  "ok": false,
  "error": {
    "code": "FILE_NOT_FOUND",
    "message": "File not found"
  }
}

Access Denied

HTTP Status: 403 Forbidden
{
  "ok": false,
  "error": {
    "code": "ACCESS_DENIED",
    "message": "Access denied: You can only view your own files or resources where you are the owner"
  }
}

Authentication Errors

HTTP Status: 401 Unauthorized
{
  "ok": false,
  "error": {
    "code": "MISSING_CREDENTIALS",
    "message": "Missing Credentials"
  }
}
{
  "ok": false,
  "error": {
    "code": "INVALID_API_KEY",
    "message": "Invalid API Key"
  }
}

Permission Errors

HTTP Status: 403 Forbidden
{
  "ok": false,
  "error": {
    "code": "INSUFFICIENT_PERMISSIONS",
    "message": "Permission check failed - PERMISSION_CHECK_FAILED"
  }
}

Best Practices

Access Control

  • Only resource you created or where you are the owner are accessible (unless you have admin or auditor role)
  • Use downloadUrl you get from documents API as a API endpoint right here.