API Documentation

Last Updated: November 07, 2024

Integrate Gofile's powerful storage and content delivery capabilities into your applications with our REST API.

BETA Status

This API is currently in BETA and may undergo changes and improvements. We recommend checking this documentation regularly for updates and new features.

Authentication

All API requests require an API token for authentication. Include your token in the request headers:

Authorization: Bearer YOUR_API_TOKEN

Get your API token from your profile page.

Rate Limits

Rate limits are enforced on a per-endpoint basis. When exceeded, requests will receive a 429 Too Many Requests response.

For security reasons, specific rate limit values are not publicly disclosed. Normal API usage should not trigger these limits.

Repeatedly exceeding rate limits may result in automatic IP bans.

Need higher limits for your use case? Contact our support team to discuss custom solutions.

Account Structure

Each account is assigned a permanent root folder that serves as the base for all content organization:

AccountRoot FolderContents (Files & Subfolders)

All files and subfolders must exist within this root structure. The root folder cannot be deleted or moved.

Returns a list of available servers for content uploads.

Parameters

Query Parameters
zone string optional

Specify region preference for server location. Available options:

eu Europe na North America

Falls back to other zones if specified zone is unavailable.

Upload files to your specified server. The server URL should be obtained from the /servers endpoint.

When uploading without parameters, the system will:
  • Create a guest account
  • Generate a new public folder in the root directory
  • Upload the file to this folder

Parameters

Content-Type: multipart/form-data
file file required

The file to be uploaded to the server

folderId string optional

Identifier of the destination folder. If not provided, a new public folder will be created.

You can reuse the guest account ID and folder ID from previous uploads to add more files to the same folder in subsequent requests.

Creates a new folder within your specified parent folder. Use this endpoint to organize your content hierarchically.

The newly created folder inherits access permissions from its parent folder. You can later modify these permissions through the folder settings.

Parameters

Content-Type: application/json
parentFolderId string required

The identifier of the parent folder where the new folder will be created. Must be a valid folder ID from your account.

folderName string optional

Custom name for the new folder. If not provided, the system will generate a unique folder name automatically.

Modify specific attributes of a file or folder. Different attributes are available depending on the content type.

Parameters

Content-Type: application/json
attribute string required

The attribute to modify. Available options:

name

Content name (files & folders)

description

Download page description (folders only)

tags

Comma-separated tags (folders only)

public

Public access status (folders only)

expiry

Expiration date timestamp (folders only)

password

Access password (folders only)

attributeValue mixed required

The new value for the specified attribute. Expected format depends on the attribute:

name String value for the content name
description Text description for the download page
tags Comma-separated string (e.g., "tag1,tag2,tag3")
public Boolean string ("true" or "false")
expiry Unix timestamp (e.g., 1704067200)
password String value for the access password
Some attributes are only available for folders. Attempting to modify these attributes on files will result in an error response.

Permanently deletes specified files and folders from your account. This action cannot be undone.

Warning: Deleting a folder will also remove all its contents, including subfolders and files.

Parameters

Content-Type: application/json
contentsId string required

A comma-separated list of content IDs to delete.

You can only delete content that belongs to your account. Attempting to delete content you don't own will result in an error.

Retrieves detailed information about a folder and its contents, including metadata and file listings.

This endpoint only works with folder IDs. File information is included within the folder details when present.

Parameters

Query Parameters
password string optional

SHA-256 hash of the password for accessing password-protected content

Required only when accessing password-protected folders

Search for files and folders within a specific parent folder based on name or tags.

The search is performed recursively through all subfolders of the specified folder. Results include both files and folders that match the search criteria.

Query Parameters

contentId string required

The identifier of the folder to search within. Must be a valid folder ID from your account.

searchedString string required

Search string to match against content names or tags.

Search Behavior
  • Matches are case-insensitive
  • Partial matches are supported (e.g., searching "doc" will match "document.pdf")
  • Results include matches in both content names and tags

Copy multiple files or folders to a specified destination folder.

Parameters

Content-Type: application/json
contentsId string required

Comma-separated list of content IDs to copy.

folderId string required

The identifier of the destination folder where contents will be copied to.

Move multiple files and/or folders to a specified destination folder. This operation preserves all content attributes and permissions while updating their location in your storage hierarchy.

Moving contents is an atomic operation - either all specified contents are moved successfully, or none are moved if an error occurs.

Parameters

Content-Type: application/json
contentsId string required

Comma-separated list of content IDs to be moved. Can include both file and folder IDs.

folderId string required

The identifier of the destination folder where the contents will be moved. Must be a valid folder ID from your account.

Moving folders will also move all their contents recursively. Ensure you have sufficient permissions in both source and destination locations.

Import public content into your account's root folder. This is useful for saving shared content to your personal storage space.

Parameters

Content-Type: application/json
contentsId string required

Comma-separated list of content IDs to import into your root folder

Only publicly accessible content can be imported. Attempting to import private or password-protected content will result in an error.

Retrieves the account ID associated with the provided API token. This endpoint is useful for identifying your account when making subsequent API calls.

The account ID is a unique identifier that represents your Gofile account and is required for various operations involving account-specific resources.

Retrieves detailed information about a specific account.

The account ID can be obtained using the /accounts/getid endpoint.

Resets your current authentication token and generates a new one. A login link containing the new token will be sent to your registered email address.

The account ID can be obtained using the /accounts/getid endpoint.
Warning: Your current token will be immediately invalidated upon request. Make sure to update your applications with the new token once received.

Need help with integration? Contact our support team.