> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thepublive.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Migration Guides

> Migrate from deprecated API endpoints to current versions

## Migrating from Deprecated CDS Endpoints

Several single-purpose CDS endpoints have been deprecated in favor of the unified [Post Listing](/dxp/api-reference/content-delivery/post-listing) endpoint with query filters.

### Posts by Category

<Expandable title="Before / After">
  ```bash theme={null}
  # Before (deprecated)
  GET /posts_by_category/100/

  # After
  GET /posts/?categories.id__eq=100
  ```
</Expandable>

### Posts by Tag

<Expandable title="Before / After">
  ```bash theme={null}
  # Before (deprecated)
  GET /posts_by_tag/500/

  # After
  GET /posts/?tags.id__eq=500
  ```
</Expandable>

### Posts by Author

<Expandable title="Before / After">
  ```bash theme={null}
  # Before (deprecated)
  GET /posts_by_author/1/

  # After
  GET /posts/?contributors.id__eq=1
  ```
</Expandable>

### Latest Posts by Type

<Expandable title="Before / After">
  ```bash theme={null}
  # Before (deprecated)
  GET /latest-posts/Article/

  # After
  GET /posts/?type__eq=Article&sort_by=created_at&sort_order=desc
  ```
</Expandable>

### Homepage

<Expandable title="Before / After">
  ```bash theme={null}
  # Before (deprecated)
  GET /homepage/

  # After
  GET /posts/?limit=20&sort_by=created_at&sort_order=desc
  ```
</Expandable>

### Search

<Expandable title="Before / After">
  ```bash theme={null}
  # Before (deprecated)
  GET /search/?q=budget

  # After
  GET /posts/?title__contains=budget
  ```
</Expandable>

### Post by Slug

<Expandable title="Before / After">
  ```bash theme={null}
  # Before (deprecated)
  GET /posts_by_slug/my-article-slug/

  # After
  GET /post/my-article-slug/
  ```
</Expandable>

### Related Posts

<Expandable title="Before / After">
  ```bash theme={null}
  # Before (deprecated)
  GET /related-posts/12345/

  # After (filter by same primary category)
  GET /posts/?primary_category.id__eq=100&limit=5
  ```
</Expandable>

## Benefits of Migration

The new `/posts/` endpoint provides:

* **Advanced filtering** with operators (`__eq`, `__contains`, `__in`, `__gte`, `__lte`)
* **Sorting** with `sort_by` and `sort_order` parameters
* **Combined filters** for complex queries
* **Consistent pagination** across all queries
* **Cache-Tags** for CDN integration

## Migration Checklist

* Identify all deprecated endpoint calls in your codebase
* Replace each with the equivalent `/posts/` query
* Test that response data matches expected format
* Update any response parsing (field names are consistent)
* Monitor for deprecation warnings in API responses

## Content Migration Strategies

### Backdated Publishing

When migrating historical content from legacy systems, you must preserve the original publication dates instead of using the time of import.

You can accomplish this by directly updating the post with the `custom_published_at` property:

```bash theme={null}
curl -X PATCH \
  'https://cms.thepublive.com/publisher/<PUBLISHER_ID>/post/<POST_ID>/' \
  -H 'Authorization: Basic <BASE64_AUTH_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{
    "status": "Published",
    "custom_published_at": "2025-12-15T10:00:00Z"
  }'
```
