# Cancel Post

Source: https://recoupable.dev/docs/api-reference/publishing/cancel

Cancel post

## DELETE /api/posts/{id}

Full OpenAPI specification: https://recoupable.dev/docs/spec/social.json

## Authentication

This operation requires one of the security alternatives in the specification below. Security scheme definitions are included where present in the published specification.

[Authentication guide](https://recoupable.dev/docs/authentication)

## Operation and referenced schemas

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Recoup API - Social",
    "description": "API documentation for the Recoup platform - an AI agent platform for the music industry",
    "license": {
      "name": "MIT"
    },
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.recoupable.dev"
    }
  ],
  "paths": {
    "/api/posts/{id}": {
      "delete": {
        "summary": "Cancel post",
        "description": "**Availability: pending.** This endpoint is specified ahead of implementation and is not yet live on the hosted API; it ships through recoupable/app#2241. Do not rely on it until this notice is removed.\n\nCancel a post that is still `scheduled`. Nothing is sent to the platform. A post that is already `publishing`, `posted`, `failed` or `cancelled` cannot be cancelled (409); to remove a live post, delete it on the platform.",
        "security": [
          {
            "apiKeyAuth": []
          },
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The post's id, from [Create Post](/docs/api-reference/publishing/create)."
          },
          {
            "name": "account_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Optional. Act on behalf of another account you can access. Defaults to the calling account."
          }
        ],
        "responses": {
          "200": {
            "description": "The post is cancelled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatePostResponse"
                }
              }
            }
          },
          "400": {
            "description": "`id` is not a valid uuid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Access denied to this post's account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No post with that id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "The post is not `scheduled`, so it can no longer be cancelled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostErrorResponse"
                }
              }
            }
          }
        },
        "x-recoup-availability": "pending"
      }
    }
  },
  "components": {
    "schemas": {
      "CreatePostResponse": {
        "type": "object",
        "required": [
          "id",
          "status"
        ],
        "description": "The post's id and current status.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The post's id. Poll [Get Post](/docs/api-reference/publishing/get) with this."
          },
          "status": {
            "$ref": "#/components/schemas/PostStatus"
          }
        }
      },
      "PostErrorResponse": {
        "type": "object",
        "required": [
          "status",
          "error"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "error"
            ],
            "description": "Always `error`"
          },
          "missing_fields": {
            "type": "array",
            "description": "JSON path segments to the first field that failed validation, e.g. `[\"description\"]`",
            "items": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            }
          },
          "error": {
            "type": "string",
            "description": "Human-readable error message"
          }
        }
      },
      "PostStatus": {
        "type": "string",
        "enum": [
          "scheduled",
          "publishing",
          "posted",
          "failed",
          "cancelled"
        ],
        "description": "Lifecycle phase. `scheduled` until `publish_at`, `publishing` while the platform upload runs, then `posted` or `failed`. `cancelled` only from `scheduled`."
      }
    },
    "securitySchemes": {
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Your Recoup API key. [Learn more](/docs/quickstart#api-keys)."
      },
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
```
