> ## 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.

# Replace File Chapters

> Atomically replace the authored chapter list for a team-owned file.



## OpenAPI

````yaml /openapi/mio-openapi.json put /api/v1/teams/{team_id}/files/{id}/chapters
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}/chapters:
    put:
      tags:
        - media-admin
      summary: Replace File Chapters
      description: Atomically replace the authored chapter list for a team-owned file.
      operationId: media_admin.put_media_admin_put_teams_by_team_id_files_by_id_chapters
      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
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/FileChaptersWriteRequest'
        required: true
      responses:
        '200':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/FileChapterListResponse'
          description: Successful Response
        '422':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    FileChaptersWriteRequest:
      properties:
        data:
          $ref: '#/components/schemas/FileChaptersWriteData'
      required:
        - data
      title: FileChaptersWriteRequest
      type: object
    FileChapterListResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/JsonApiResource_FileChapterAttributes_'
          title: Data
          type: array
        included:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Included
        links:
          anyOf:
            - $ref: '#/components/schemas/JsonApiPaginationLinks'
            - type: 'null'
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
      required:
        - data
      title: FileChapterListResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    FileChaptersWriteData:
      properties:
        attributes:
          $ref: '#/components/schemas/FileChaptersWriteAttributes'
        type:
          const: file_chapters
          default: file_chapters
          title: Type
          type: string
      required:
        - attributes
      title: FileChaptersWriteData
      type: object
    JsonApiResource_FileChapterAttributes_:
      properties:
        attributes:
          $ref: '#/components/schemas/FileChapterAttributes'
        id:
          title: Id
          type: string
        links:
          anyOf:
            - $ref: '#/components/schemas/JsonApiLinks'
            - type: 'null'
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
        relationships:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Relationships
        type:
          title: Type
          type: string
      required:
        - id
        - type
        - attributes
      title: JsonApiResource[FileChapterAttributes]
      type: object
    JsonApiPaginationLinks:
      properties:
        next:
          anyOf:
            - type: string
            - type: 'null'
          title: Next
        self:
          anyOf:
            - type: string
            - type: 'null'
          title: Self
      title: JsonApiPaginationLinks
      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
    FileChaptersWriteAttributes:
      additionalProperties: false
      properties:
        chapters:
          items:
            $ref: '#/components/schemas/FileChapterInput'
          title: Chapters
          type: array
      title: FileChaptersWriteAttributes
      type: object
    FileChapterAttributes:
      properties:
        created_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Created At
        end:
          anyOf:
            - type: integer
            - type: 'null'
          title: End
        position:
          title: Position
          type: integer
        source:
          enum:
            - authored
            - auto
          title: Source
          type: string
        start:
          title: Start
          type: integer
        title:
          title: Title
          type: string
        updated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Updated At
      required:
        - title
        - start
        - position
        - source
      title: FileChapterAttributes
      type: object
    JsonApiLinks:
      properties:
        self:
          anyOf:
            - type: string
            - type: 'null'
          title: Self
      title: JsonApiLinks
      type: object
    FileChapterInput:
      additionalProperties: false
      description: One chapter in a full-list replace request.
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        start:
          maximum: 2147483647
          minimum: 0
          title: Start
          type: integer
        title:
          maxLength: 200
          minLength: 1
          title: Title
          type: string
      required:
        - title
        - start
      title: FileChapterInput
      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

````