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

# Retrieve a message attachment

> Returns one message attachment by its id.



## OpenAPI

````yaml /openapi-v1.json get /v1/messages/{message_id}/attachments/{file_id}
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/messages/{message_id}/attachments/{file_id}:
    get:
      tags:
        - Messages
      summary: Retrieve a message attachment
      description: Returns one message attachment by its id.
      operationId: getMessageAttachment
      parameters:
        - schema:
            type: string
            pattern: ^msg_[a-zA-Z0-9]{12}$
            description: The message's id.
          required: true
          description: The message's id.
          name: message_id
          in: path
        - schema:
            type: string
            pattern: ^file_[a-zA-Z0-9]{12}$
            description: The id of the attached file.
          required: true
          description: The id of the attached file.
          name: file_id
          in: path
        - schema:
            anyOf:
              - type: string
                enum:
                  - file
              - type: array
                items:
                  type: string
                  enum:
                    - file
                maxItems: 1
            description: 'Repeatable. Returns the named relation inline. One of: `file`.'
          required: false
          description: 'Repeatable. Returns the named relation inline. One of: `file`.'
          name: expand
          in: query
          style: form
          explode: true
      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/MessageAttachment'
        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:
    MessageAttachment:
      type: object
      properties:
        object:
          type: string
          enum:
            - message_attachment
          description: Always `message_attachment`.
        id:
          type: string
          description: >-
            The attached file’s id, which keys the attachment within its
            message.
          example: file_2b3c4d5e6f7g
        message_id:
          type: string
          description: The id of the message the file is attached to.
          example: msg_9f2b8c1d4e5a
        file_id:
          type: string
          description: The id of the attached file.
          example: file_2b3c4d5e6f7g
        position:
          type: integer
          minimum: 0
          description: >-
            Where the file sits among the message’s attachments, counting from
            zero.
        created_at:
          type: string
          format: date-time
          description: >-
            When the attachment was last written, which an edit to the message’s
            body or images resets.
        file:
          $ref: '#/components/schemas/File'
      required:
        - object
        - id
        - message_id
        - file_id
        - position
        - created_at
    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
    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.
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      bearerFormat: Tightknit API key
      description: 'A Tightknit admin API key, sent as `Authorization: Bearer <key>`.'

````

## Related topics

- [Retrieve a message](https://docs.tightknit.ai/v1/api-reference/messages/retrieve-a-message.md)
- [Retrieve a pinned message](https://docs.tightknit.ai/v1/api-reference/feeds/retrieve-a-pinned-message.md)
- [List message attachments](https://docs.tightknit.ai/v1/api-reference/messages/list-message-attachments.md)
- [Retrieve a message version](https://docs.tightknit.ai/v1/api-reference/messages/retrieve-a-message-version.md)
- [Working With File Attachments](https://docs.tightknit.ai/slack/working-with-file-attachments.md)


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