Goatlab API Docs

Get download URL for a file in a space

GET
/v1/spaces/{spaceId}/files/{fileId}/download-url

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

Access Control:

Access to download a file from a space depends on your permissions and the space's visibility:

  • Private Spaces: Only accessible by the space owner
  • Public Spaces: Accessible by all users within the same tenant

The file must belong to the specified space. Files cannot be accessed through a different space than the one they were uploaded to.

Authorization

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

API Key with role based permission

In: header

Scope: PRODUCT, GEN_AI

Path Parameters

spaceId*string

The unique identifier of the space containing the file

fileId*string

The unique identifier of the file to download

Header Parameters

x-user-id*string

The ID of the user requesting the download URL

x-tenant-id*string

The ID of the tenant

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/spaces/497f6eca-6276-4993-bfeb-53cbbbba6f08/files/497f6eca-6276-4993-bfeb-53cbbbba6f08/download-url" \  -H "x-user-id: string" \  -H "x-tenant-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": "Space not found"
}

{
  "message": "File is either malicious or still being checked by antivirus"
}
{
  "message": "Internal Server Error"
}