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

# Delete Blog Post via Write API

> Soft-delete an existing blog post via the Write API. The post is hidden from public endpoints and its slug is reassigned to a generated value; other data is kept.

Delete an existing blog post using a soft delete operation that marks the post as deleted, removes it from public visibility and reassigns its slug. The post's content and metadata are otherwise kept in the system.

**Soft Delete Behavior**: The post is marked as deleted in the system and will no longer appear in blog listings, search results, RSS feeds, or other public endpoints. Content and metadata are otherwise preserved, but the post's slug is reassigned to a generated value (so the original slug is immediately free for a new post). Recovering the original slug would require support to restore it manually.

**Localization**: Use the `locale` query parameter to specify which locale variant to delete (e.g. `?locale=es`). When omitted, the post's current locale is used. If the specified locale variant does not exist, a 404 Not Found response is returned.

**Access Control**: You can only delete blog posts that belong to your organization. Attempting to delete posts from other organizations will result in a 404 Not Found response, ensuring proper data isolation and security.


## OpenAPI

````yaml /api/openapi/write_api.yaml delete /posts/{slug}/
openapi: 3.1.0
info:
  title: ButterCMS Write API
  version: 2.0.0
  description: >
    Write endpoints for the ButterCMS API — create, update, and delete Pages,
    Collections, and Blog Posts.


    **Authentication**: pass your write-enabled token via the `Authorization:
    Token <token>` header. A `?auth_token=` query parameter also works (the same
    mechanism as the Read API), but avoid it for write requests: a write token
    is higher-privilege and a URL is more likely to be logged or leaked than a
    header.
  contact:
    email: support@buttercms.com
  license:
    name: ButterCMS Terms of Service
    url: https://buttercms.com/terms/
servers:
  - url: https://api.buttercms.com/v2
    description: ButterCMS API v2
security:
  - writeTokenAuth: []
tags:
  - name: Pages
    description: >
      Create new pages using ButterCMS Write API. Programmatically create
      content to enable powerful use cases and scale your content faster.


      Note: For Pages, PUT behaves like PATCH (partial update). Use either
      method to perform partial updates.
  - name: Collections
    description: >
      Create, update, and delete Collection items using ButterCMS Write API.
      Collections are user-defined content structures with completely
      customizable field schemas.
  - name: Blog posts
    description: >
      Create, update, and delete blog posts using ButterCMS Write API. Blog
      posts support rich content including HTML body, categories, tags, featured
      images, and SEO metadata.
paths:
  /posts/{slug}/:
    delete:
      tags:
        - Blog posts
      summary: Delete Blog Post via Write API
      description: >
        Delete an existing blog post using a soft delete operation that marks
        the post as deleted, removes it from public visibility and reassigns its
        slug. The post's content and metadata are otherwise kept in the system.


        **Soft Delete Behavior**: The post is marked as deleted in the system
        and will no longer appear in blog listings, search results, RSS feeds,
        or other public endpoints. Content and metadata are otherwise preserved,
        but the post's slug is reassigned to a generated value (so the original
        slug is immediately free for a new post). Recovering the original slug
        would require support to restore it manually.


        **Localization**: Use the `locale` query parameter to specify which
        locale variant to delete (e.g. `?locale=es`). When omitted, the post's
        current locale is used. If the specified locale variant does not exist,
        a 404 Not Found response is returned.


        **Access Control**: You can only delete blog posts that belong to your
        organization. Attempting to delete posts from other organizations will
        result in a 404 Not Found response, ensuring proper data isolation and
        security.
      operationId: deleteBlogPost
      parameters:
        - name: slug
          in: path
          required: true
          description: |
            The slug of the blog post to delete.
          schema:
            type: string
            maxLength: 100
          example: this-is-a-blog-post
        - name: locale
          in: query
          description: >
            Delete this locale variant of the post (e.g. `en`, `es`). When
            omitted, deletes the post in its current locale. Returns 404 if the
            locale variant does not exist.
          required: false
          schema:
            type: string
            maxLength: 10
          example: en
      responses:
        '204':
          description: >
            **No Content - Blog Post Successfully Deleted**


            The blog post has been successfully deleted (soft delete). The
            response body is empty.


            **Note**: This is a soft delete operation. The post is marked as
            deleted but not physically removed from the system.
        '401':
          $ref: '#/components/responses/UnauthorizedWriteResponse'
        '403':
          description: >
            **Forbidden - Insufficient Permissions**


            Your API token does not have write permissions. Only write-enabled
            API tokens can delete blog posts.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail: Your API token does not allow writes.
        '404':
          description: >
            **Not Found - Blog Post Does Not Exist or Already Deleted**


            The blog post with the specified slug was not found. This can happen
            if:


            - The blog post doesn't exist

            - The blog post belongs to a different organization

            - The blog post has already been deleted

            - You don't have access to the blog post
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail: Not found.
      security:
        - writeTokenAuth: []
components:
  responses:
    UnauthorizedWriteResponse:
      description: >
        **Unauthorized - Missing or Invalid API Token**


        No token was sent, or the token isn't valid. A valid Read API token on a
        write request returns `403` with `Your API token does not allow writes.`
        instead.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missing_token:
              summary: Missing API token
              value:
                detail: Authentication credentials were not provided.
            invalid_token:
              summary: Invalid API token
              value:
                detail: Invalid token.
  schemas:
    ErrorResponse:
      type: object
      properties:
        detail:
          type: string
          description: Error message describing what went wrong
          example: Authentication credentials were not provided.
  securitySchemes:
    writeTokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >
        Write-enabled API token required for creating content.


        The API token you use for reading from the ButterCMS API will not allow
        you to create content in the API. For this you will need to use a
        different write-enabled token. Write API access is a paid add-on for
        Advanced and Professional plans, enabled from the Billing page of your
        account. It isn't offered on Basic plans.


        Set the `Authorization` header to `Token your_write_api_token`. The
        `?auth_token=` query parameter also works for write requests, but a
        header is safer because URLs are more likely to be logged.


        Example: `Authorization: Token abc123def456`


        Your write-enabled token should never be used anywhere it would be
        exposed, e.g. in client-side JavaScript.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.