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

# Upload a file

> Uploads one file as multipart form data. `file_category` says where the file will be used; in v1, an event's `cover_image_file_id` is the only field that takes the returned id. Refused with a 400: an empty file, a type its category does not take, and an image whose format, dimensions or size do not fit its category. A file over the community's upload size limit is refused with a 413 or a 400.



## OpenAPI

````yaml /openapi-v1.json post /v1/files
openapi: 3.1.0
info:
  title: Tightknit Admin API
  version: 1.0.0
  description: Administrative access to a Tightknit community.
servers:
  - url: https://api.tightknit.ai
security:
  - Bearer: []
tags:
  - name: API keys
    description: Inspect the key a request authenticated with.
  - name: Awards
    description: Badges and certificates a community grants its members.
  - name: Events
    description: Read, create, update and delete events on the community calendar.
  - name: Journeys
    description: Read multi-step member programs and their milestones.
  - name: Tags
    description: The labels that classify events and content resources.
  - name: Groups
    description: The segments a community sorts its members into.
  - name: Content
    description: >-
      The collections a community files its content under, and the links and
      events in them.
  - name: Feeds
    description: The Slack channels and site-only spaces a community posts in.
  - name: Files
    description: Images and documents a community has uploaded.
  - name: Messages
    description: What a community has published.
  - name: Members
    description: The people in a community.
  - name: Slack messages
    description: >-
      Messages sent to Slack. Sending is the only operation: they cannot be
      read, edited or deleted here.
  - name: Compositions
    description: >-
      Message Blaster drafts: messages saved in Studio before, and kept after,
      they are sent to Slack channels and members. An API key sees only the
      compositions shared with every Studio user.
  - name: Follows
    description: What a member follows.
  - name: Polls
    description: The questions a community puts to its members in Slack.
  - name: Activity logs
    description: What members did in the community, and when.
  - name: System
    description: Service health.
paths:
  /v1/files:
    post:
      tags:
        - Files
      summary: Upload a file
      description: >-
        Uploads one file as multipart form data. `file_category` says where the
        file will be used; in v1, an event's `cover_image_file_id` is the only
        field that takes the returned id. Refused with a 400: an empty file, a
        type its category does not take, and an image whose format, dimensions
        or size do not fit its category. A file over the community's upload size
        limit is refused with a 413 or a 400.
      operationId: createFile
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/FileCreate'
      responses:
        '200':
          description: Success
          headers:
            Request-Id:
              description: Identifier for this request, quote it in support tickets.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/File'
        default:
          description: Error
          headers:
            Request-Id:
              description: Identifier for this request, quote it in support tickets.
              schema:
                type: string
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      security:
        - Bearer: []
components:
  schemas:
    FileCreate:
      type: object
      properties:
        file:
          type: string
          format: binary
          description: The file bytes.
        file_category:
          type: string
          enum:
            - calendar-event-cover
            - calendar-events-banner
            - site-logo
            - site-combination-logo
            - site-favicon
            - site-social-image
            - home-page-banner
            - members-banner
            - content-library-banner
            - feed-banner
            - group-banner
            - groups-banner
            - community-icon
            - community-home-banner
            - award-badge
            - award-overlay-frame
            - award-cert-template
            - content-resource-cover
            - content-collection-cover
            - login-marketing-panel
            - composition-image
          description: >-
            What the file is for. Each category takes an image validated against
            that slot. One of:

            - `calendar-event-cover`: an event’s cover image, its
            `cover_image_file_id`.

            - `calendar-events-banner`: the banner of the community site’s
            events page.

            - `site-logo`: the community site’s square logo icon.

            - `site-combination-logo`: the community site’s horizontal logo.

            - `site-favicon`: the icon browsers show in the community site’s
            tab.

            - `site-social-image`: the image shown when a link to the community
            site is shared.

            - `home-page-banner`: the banner of the community site’s home page.

            - `members-banner`: the banner of the community site’s members page.

            - `content-library-banner`: the banner of the community site’s
            content library.

            - `feed-banner`: a feed’s banner.

            - `group-banner`: a group’s banner.

            - `groups-banner`: the banner of the community site’s groups page.

            - `community-icon`: the square logo used as the community’s avatar.

            - `community-home-banner`: the banner of the Community Home members
            see when they open Tightknit in Slack.

            - `award-badge`: an award’s badge image.

            - `award-overlay-frame`: the frame an award lays over its holders’
            profile photos.

            - `award-cert-template`: the template an award’s certificates are
            drawn on.

            - `content-resource-cover`: a content resource’s cover image.

            - `content-collection-cover`: a content collection’s cover image.

            - `login-marketing-panel`: the image beside the sign-in form on the
            community site’s login page.

            - `composition-image`: an image in a Message Blaster message.
          example: calendar-event-cover
        filename:
          type: string
          maxLength: 100
          pattern: ^(?!\.+$)[a-zA-Z0-9_.-]+$
          description: The stored name, whose extension declares the file type.
          example: cover.png
        description:
          type: string
          minLength: 1
          maxLength: 150
          pattern: ^\P{Cc}*$/u
          description: >-
            Alt text or a short description, stored as the title. Defaults to
            `filename`.
          example: Launch cover
      required:
        - file
        - file_category
        - filename
      additionalProperties: false
    File:
      type: object
      properties:
        object:
          type: string
          enum:
            - file
          description: Always `file`.
        id:
          type: string
          description: Unique identifier for the object.
          example: file_2b3c4d5e6f7g
        name:
          type: string
          description: The file’s stored name, including its extension.
          example: cover.png
        title:
          type:
            - string
            - 'null'
          description: >-
            Alt text or a short description of the file. An upload without one
            takes the filename. Null when none was recorded.
        mimetype:
          type: string
          description: The file’s media type.
          example: image/png
        size:
          type: integer
          minimum: 0
          description: The file’s size in bytes.
        url:
          type: string
          description: Where to download the file.
        thumbnail_url:
          type:
            - string
            - 'null'
          description: A smaller preview of the file. Null when it has none.
        created_at:
          type: string
          format: date-time
          description: When the file was stored.
      required:
        - object
        - id
        - name
        - title
        - mimetype
        - size
        - url
        - thumbnail_url
        - created_at
      description: A file the community stored, uploaded or generated.
    Problem:
      type: object
      properties:
        type:
          type: string
          description: A URI naming the problem type. Always `about:blank`.
          example: about:blank
        title:
          type: string
          description: A short summary of the HTTP status.
          example: Not found
        status:
          type: integer
          description: The HTTP status code.
          example: 404
        detail:
          type: string
          description: What went wrong with this request, when there is more to say.
        code:
          type: string
          description: >-
            A stable, machine-readable error code to branch on, unlike `title`
            and `detail`.
          example: not_found
        param:
          type: string
          description: The request field or parameter the error is about, when one is.
        request_id:
          type: string
          description: >-
            The id of the request, also sent as the `Request-Id` header. Quote
            it in support tickets.
          example: req_9f2b8c1d4e5a6b7c8d9e0f1a2b3c4d5e
      required:
        - type
        - title
        - status
        - code
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      bearerFormat: Tightknit API key
      description: 'A Tightknit admin API key, sent as `Authorization: Bearer <key>`.'

````

## Related topics

- [Working With File Attachments](https://docs.tightknit.ai/slack/working-with-file-attachments.md)
- [MCP Server](https://docs.tightknit.ai/integrations/mcp.md)
- [Branding Guide](https://docs.tightknit.ai/branding.md)
- [Tightknit Admin API v1 Introduction](https://docs.tightknit.ai/v1/api-reference/introduction.md)
- [Pages](https://docs.tightknit.ai/community-site/pages.md)


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