Goatlab API Docs

Get files in a space

GET
/v1/spaces/{spaceId}/files

Retrieves files within a specific space.

The response will include metadata about each file, such as its ID, name, and upload date.

Each file item also includes ownerId and the extracted metadata fields when available: summary, language, domain, documentKind, extractionStatus, and tags, a list of the additional key-value fields stored during the extraction process (e.g. author, createdDate).

The files will be returned in a paginated format, with the specified page and limit parameters controlling the results.

Results can be sorted using sortBy and sortOrder.

Access Control:

Access to a files list 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 files must belong to the specified space. Files cannot be accessed through a different space than the one they were uploaded to.

Authorization

ApiTokenAuth PRODUCT
x-api-key<token>

API Key with role based permission

In: header

Scope: PRODUCT

Path Parameters

spaceId*string

The unique identifier of the space containing the files

Query Parameters

page?integer

The page number to retrieve

limit?integer

The number of files to retrieve per page

sortBy?string

Field to sort by

sortOrder?string

Sort order (ascending or descending)

status?string

Filters files by processing status. Defaults to successful, which only returns files that finished processing and passed the antivirus scan.

  • successful: files that have been processed and did not fail the antivirus scan
  • failed: files whose processing failed
  • processing: files currently being scanned or processed
  • pending_upload: files that have not been uploaded yet
  • all: files regardless of processing or antivirus status
persistence?string

Filters files by persistence. Defaults to persistent, which only returns files that do not have an expiration date.

  • persistent: files with no expiration date
  • temporal: files that have an expiration date
  • all: files regardless of expiration date

Header Parameters

x-user-id*string

The ID of the user requesting the file status

x-tenant-id*string

The ID of the tenant

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/spaces/497f6eca-6276-4993-bfeb-53cbbbba6f08/files" \  -H "x-user-id: string" \  -H "x-tenant-id: string"
{
  "data": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "originalName": "document.pdf",
      "size": 204800,
      "processingStatus": "PROCESSED",
      "createdAt": "2026-01-05T10:30:00.000Z",
      "updatedAt": "2026-01-05T10:30:00.000Z",
      "ownerId": "user-123",
      "summary": "Quarterly financial overview for Q3 2025.",
      "language": "en",
      "domain": "Finance",
      "documentKind": "Report",
      "extractionStatus": "COMPLETED",
      "tags": [
        {
          "key": "author",
          "value": "Jane Doe",
          "aiExtracted": true
        }
      ],
      "warnings": {
        "length": false,
        "infected": false,
        "empty": false,
        "images": false
      },
      "chunksCount": 12,
      "charactersCount": 15240
    },
    {
      "id": "223e4567-e89b-12d3-a456-426614174001",
      "originalName": "document2.pdf",
      "size": 102400,
      "processingStatus": "PROCESSING",
      "createdAt": "2026-01-06T11:00:00.000Z",
      "updatedAt": "2026-01-06T11:00:00.000Z",
      "ownerId": "user-789",
      "summary": null,
      "language": null,
      "domain": null,
      "documentKind": null,
      "extractionStatus": "PENDING",
      "tags": [],
      "warnings": {
        "length": true,
        "infected": false,
        "empty": false,
        "images": true
      },
      "chunksCount": 8,
      "charactersCount": 9800
    }
  ],
  "limit": 30,
  "page": 1,
  "total": 2
}

{
  "message": "x-user-id is required"
}

{
  "message": "Invalid API Key"
}
{
  "message": "Space not found"
}
{
  "message": "Internal Server Error"
}