Goatlab API Docs

Get download URL for a file

GET
/v1/files/{file_id}/download-url

Generates a pre-signed URL that can be used to download a previously uploaded file directly from storage. The URL is temporary and will expire after a set period.

You must provide the file ID in the path and the user ID in the headers.

Authorization

ApiTokenAuth PRODUCT, GEN_AI
x-api-key<token>

API Key with role based permission

In: header

Scope: PRODUCT, GEN_AI

Path Parameters

file_id*string

The ID of the file to download

Header Parameters

x-user-id*string

The ID of the user requesting the download URL

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/files/497f6eca-6276-4993-bfeb-53cbbbba6f08/download-url" \  -H "x-user-id: string"
{
  "url": "https://s3.amazonaws.com/bucket/path/file.pdf?X-Amz-Signature=..."
}
{
  "message": {
    "description": "Validation failed",
    "errors": [
      {
        "path": "headers.x-user-id",
        "message": "x-user-id is required"
      }
    ]
  }
}
{
  "message": "Invalid API Key"
}
{
  "message": "Invalid API Key"
}
{
  "message": "File not found"
}
{
  "message": "File is either malicious or still being checked by antivirus"
}
{
  "message": "Internal Server Error"
}