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

# Cancel File Replacement

> Cancel a pending replacement of a file. Returns 204 with no body.

The replacement ends FAILED, which frees the file for a new replacement, and any
partial upload is aborted. This never touches the file or its current media.

Every case where there is no pending replacement of this file in this team (unknown
id, another team's id, another file's replacement, already finalized, already
cancelled) returns the same 404. A repeated cancel is a 404. Only the team owner or a
team API key may call this.



## OpenAPI

````yaml /openapi/mio-openapi.json delete /api/v1/teams/{team_id}/files/{id}/replace/{replacement_media_id}
openapi: 3.1.0
info:
  description: >-
    Production API reference for Membership.io. Use the authored guides for
    workflows and the generated endpoint pages for exact parameters and schemas.
  title: Membership.io API
  version: 0.1.0
servers:
  - description: Production
    url: https://api.member.dev
security:
  - bearerAuth: []
paths:
  /api/v1/teams/{team_id}/files/{id}/replace/{replacement_media_id}:
    delete:
      tags:
        - media-admin
      summary: Cancel File Replacement
      description: >-
        Cancel a pending replacement of a file. Returns 204 with no body.


        The replacement ends FAILED, which frees the file for a new replacement,
        and any

        partial upload is aborted. This never touches the file or its current
        media.


        Every case where there is no pending replacement of this file in this
        team (unknown

        id, another team's id, another file's replacement, already finalized,
        already

        cancelled) returns the same 404. A repeated cancel is a 404. Only the
        team owner or a

        team API key may call this.
      operationId: >-
        media_admin.delete_media_admin_delete_teams_by_team_id_files_by_id_replace_by_replacement_media_id
      parameters:
        - in: path
          name: team_id
          required: true
          schema:
            title: Team Id
            type: string
        - in: path
          name: id
          required: true
          schema:
            title: Id
            type: string
        - in: path
          name: replacement_media_id
          required: true
          schema:
            title: Replacement Media Id
            type: string
      responses:
        '204':
          description: Successful Response
        '422':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT or mio_sk API key
      description: >-
        Send platform JWTs, contact JWTs, or team API keys as `Authorization:
        Bearer <token>`.
      scheme: bearer
      type: http
    HTTPBearer:
      scheme: bearer
      type: http

````

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