Goatlab API Docs

Get metadata for a file in a space

GET
/v1/spaces/{spaceId}/files/{fileId}/metadata

Retrieves the metadata for a specific file within a space.

The response includes structured file-level fields extracted by the AI pipeline (summary, language, domain, documentKind) as well as any additional key-value metadata fields, returned as the tags array. Absent file-level values are returned as null, and tags is an empty array when the file has no metadata.

Access Control:

Access to file metadata 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

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 retrieve metadata for

Header Parameters

x-user-id*string

The ID of the user requesting the metadata

x-tenant-id*string

The ID of the tenant

Response Body

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/metadata" \  -H "x-user-id: string" \  -H "x-tenant-id: string"
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "originalName": "document.pdf",
  "summary": "This document covers quarterly financial results for Q3 2025.",
  "language": "en",
  "documentKind": "Report",
  "domain": "Finance",
  "chunksCount": 12,
  "charactersCount": 15240,
  "tags": [
    {
      "key": "author",
      "value": "Jane Doe",
      "aiExtracted": true
    },
    {
      "key": "created_date",
      "value": "2025-09-30",
      "aiExtracted": true
    }
  ]
}

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

{
  "message": "Invalid API Key"
}
{
  "message": "Invalid API Key"
}

{
  "message": "Space not found"
}

{
  "message": "Internal Server Error"
}