curl -X GET "https://gachabe-staging.fly.dev/api/v1/collections" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/vnd.api+json"
{
  "data": [
    {
      "type": "collection",
      "id": "dragon-artifacts",
      "attributes": {
        "name": "Dragon Artifacts",
        "description": "Ancient treasures and artifacts from the dragon realm"
      },
      "relationships": {
        "collectibles": {
          "data": [
            {
              "type": "collectible",
              "id": "collectible_001"
            },
            {
              "type": "collectible", 
              "id": "collectible_002"
            }
          ]
        }
      }
    },
    {
      "type": "collection",
      "id": "elemental-gems",
      "attributes": {
        "name": "Elemental Gems",
        "description": "Gems infused with the power of the elements"
      },
      "relationships": {
        "collectibles": {
          "data": [
            {
              "type": "collectible",
              "id": "collectible_003"
            }
          ]
        }
      }
    }
  ],
  "included": [
    {
      "type": "collectible",
      "id": "collectible_001",
      "attributes": {
        "name": "Ancient Dragon Scale",
        "description": "A shimmering scale from an ancient dragon",
        "collection_id": "dragon-artifacts",
        "images": [
          "https://example.com/images/dragon-scale.png"
        ]
      }
    }
  ],
  "meta": {
    "total_count": 15,
    "page": {
      "limit": 12,
      "offset": 0
    }
  }
}
Retrieve a paginated list of all collections, with optional filtering by name. Collections organize collectibles into themed groups.

Query Parameters

sort
string
Sort order for results. Use - prefix for descending order.Available fields: id, name, descriptionExample: name,-id (name ascending, then id descending)
page
object
Pagination controls for the response.
include
string
Include related collectibles in the response.Available includes: collectibles
fields
object
Limit response fields to only those specified.
query
string
Filter collections by name containing the specified value. Case-insensitive search.
curl -X GET "https://gachabe-staging.fly.dev/api/v1/collections" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/vnd.api+json"
{
  "data": [
    {
      "type": "collection",
      "id": "dragon-artifacts",
      "attributes": {
        "name": "Dragon Artifacts",
        "description": "Ancient treasures and artifacts from the dragon realm"
      },
      "relationships": {
        "collectibles": {
          "data": [
            {
              "type": "collectible",
              "id": "collectible_001"
            },
            {
              "type": "collectible", 
              "id": "collectible_002"
            }
          ]
        }
      }
    },
    {
      "type": "collection",
      "id": "elemental-gems",
      "attributes": {
        "name": "Elemental Gems",
        "description": "Gems infused with the power of the elements"
      },
      "relationships": {
        "collectibles": {
          "data": [
            {
              "type": "collectible",
              "id": "collectible_003"
            }
          ]
        }
      }
    }
  ],
  "included": [
    {
      "type": "collectible",
      "id": "collectible_001",
      "attributes": {
        "name": "Ancient Dragon Scale",
        "description": "A shimmering scale from an ancient dragon",
        "collection_id": "dragon-artifacts",
        "images": [
          "https://example.com/images/dragon-scale.png"
        ]
      }
    }
  ],
  "meta": {
    "total_count": 15,
    "page": {
      "limit": 12,
      "offset": 0
    }
  }
}

Response Fields

data
array
required
Array of collection resource objects
included
array
Related resources included in the response when using the include parameter
meta
object
Metadata including pagination information and total counts

Common Use Cases

curl -X GET "https://gachabe-staging.fly.dev/api/v1/collections?sort=name&page[limit]=20" \
  -H "Authorization: Bearer YOUR_API_KEY"
Display a catalog of all available collections for users to explore.

Pagination Best Practices

1

Set appropriate page size

Use page[limit] to control the number of collections per request.
For UI grids, use limits that match your layout (e.g., 12, 16, 20).
2

Implement offset-based navigation

Use page[offset] to navigate through result pages.
Calculate offset as page_number * page_limit for page-based navigation.
3

Show total counts when needed

Set page[count]=true to get total result counts for pagination UI.
Total counts may impact performance on large datasets.
Collections are automatically created when collectibles are added to the system. Empty collections (without any collectibles) are not returned in the results.
Use the include=collectibles parameter sparingly as it can significantly increase response size for collections with many items.