Documentation

Files API

The Files API allows you to upload, list, retrieve, and delete files in your Get Pronto account. All file operations require authentication using your API key.

Upload File

Upload a new file to your account. The API accepts multipart/form-data uploads.

Endpoint

bash
POST /upload

Request Parameters

ParameterTypeDescription
fileFileThe file to upload
customFilenameStringOptional. Custom filename for the uploaded file

Example Request

bash
curl https://api.getpronto.io/v1/upload \
  -H "ApiKey: YOUR_API_KEY" \
  -F "file=@/path/to/image.jpg" \
  -F "customFilename=custom-name.jpg"

Response

json
{
  "message": "File uploaded successfully",
  "file": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "filename": "custom-name.jpg",
    "mimetype": "image/jpeg",
    "size": 1024000,
    "createdAt": "2024-03-28T12:00:00Z",
    "url": "https://api.getpronto.io/v1/file/custom-name.jpg"
  }
}

List Files

Retrieve a paginated list of files in your account.

Endpoint

bash
GET /files

Query Parameters

ParameterTypeDescription
pageIntegerPage number (default: 1)
pageSizeIntegerItems per page (default: 20, max: 100)

Example Request

bash
curl https://api.getpronto.io/v1/files?page=1&pageSize=20 \
  -H "ApiKey: YOUR_API_KEY"

Response

json
{
  "files": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "filename": "image.jpg",
      "mimetype": "image/jpeg",
      "size": 1024000,
      "createdAt": "2024-03-28T12:00:00Z",
      "url": "https://api.getpronto.io/v1/file/image.jpg"
    }
  ],
  "pagination": {
    "page": 1,
    "pageSize": 20,
    "totalCount": 135,
    "totalPages": 7
  }
}

Get File

Retrieve metadata for a specific file by its ID.

Endpoint

bash
GET /files/:id

Path Parameters

ParameterTypeDescription
idStringThe unique identifier of the file

Example Request

bash
curl https://api.getpronto.io/v1/files/123e4567-e89b-12d3-a456-426614174000 \
  -H "ApiKey: YOUR_API_KEY"

Response

json
{
  "file": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "filename": "image.jpg",
    "mimetype": "image/jpeg",
    "size": 1024000,
    "createdAt": "2024-03-28T12:00:00Z",
    "url": "https://api.getpronto.io/v1/file/image.jpg"
  }
}

Delete File

Permanently delete a file from your account.

Endpoint

bash
DELETE /files/:id

Path Parameters

ParameterTypeDescription
idStringThe unique identifier of the file to delete

Example Request

bash
curl -X DELETE https://api.getpronto.io/v1/files/123e4567-e89b-12d3-a456-426614174000 \
  -H "ApiKey: YOUR_API_KEY"

Response

json
{
  "message": "File deleted successfully"
}

File Object

The file object contains the following properties:

ParameterTypeDescription
idStringUnique identifier for the file
filenameStringName of the file
mimetypeStringMIME type of the file
sizeNumberSize of the file in bytes
createdAtStringISO 8601 timestamp of when the file was created
urlStringDirect URL to access the file

Example File Object

json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "filename": "image.jpg",
  "mimetype": "image/jpeg",
  "size": 1024000,
  "createdAt": "2024-03-28T12:00:00Z",
  "url": "https://api.getpronto.io/v1/file/image.jpg"
}

Next Steps

Continue exploring our documentation with these related topics: