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

# Create File

> Create a new file row and return a presigned S3 PUT URL.

The client uploads the file directly to S3 using the returned upload_url,
then calls POST /api/teams/{team_id}/files/{id}/finalize to confirm the
upload succeeded and transition status_upload PENDING → READY.

Rate limited to MEDIA_UPLOAD_RATE_LIMIT_PER_HOUR requests per team per hour.
Returns 413 if the team's storage quota would be exceeded.
Returns 429 if the per-team rate limit is exceeded.



## OpenAPI

````yaml /openapi/mio-openapi.json post /api/v1/teams/{team_id}/files
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:
    post:
      tags:
        - media-admin
      summary: Create File
      description: >-
        Create a new file row and return a presigned S3 PUT URL.


        The client uploads the file directly to S3 using the returned
        upload_url,

        then calls POST /api/teams/{team_id}/files/{id}/finalize to confirm the

        upload succeeded and transition status_upload PENDING → READY.


        Rate limited to MEDIA_UPLOAD_RATE_LIMIT_PER_HOUR requests per team per
        hour.

        Returns 413 if the team's storage quota would be exceeded.

        Returns 429 if the per-team rate limit is exceeded.
      operationId: media_admin.post_media_admin_post_teams_by_team_id_files
      parameters:
        - in: path
          name: team_id
          required: true
          schema:
            title: Team Id
            type: string
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/FileCreateRequest'
        required: true
      responses:
        '201':
          content:
            application/vnd.api+json:
              schema: {}
          description: Successful Response
        '422':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    FileCreateRequest:
      description: Request body for POST /api/teams/{team_id}/files.
      properties:
        data:
          $ref: '#/components/schemas/FileCreateData'
      required:
        - data
      title: FileCreateRequest
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    FileCreateData:
      properties:
        attributes:
          $ref: '#/components/schemas/FileCreateAttributes'
        type:
          const: files
          default: files
          title: Type
          type: string
      required:
        - attributes
      title: FileCreateData
      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
    FileCreateAttributes:
      properties:
        mime_type:
          description: MIME type of the file.
          maxLength: 128
          minLength: 1
          title: Mime Type
          type: string
        size_bytes:
          description: File size in bytes.
          exclusiveMinimum: 0
          title: Size Bytes
          type: integer
        title:
          description: Human-readable file name.
          maxLength: 512
          minLength: 1
          title: Title
          type: string
      required:
        - title
        - mime_type
        - size_bytes
      title: FileCreateAttributes
      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

````