# Create Attachment

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/content/management/{entity}/{entity_id}/attachments:
    post:
      summary: Create Attachment
      deprecated: false
      description: ''
      tags:
        - API Reference/Management API/CMS/Extensions/Attachments
      parameters:
        - name: entity
          in: path
          description: Type of cms content that can have attachments
          required: true
          example: press_releases
          schema:
            type: string
            enum:
              - press_releases
            x-apidog-enum:
              - value: press_releases
                name: ''
                description: ''
        - name: entity_id
          in: path
          description: Identifier of cms content that can have attachments
          required: true
          example: 1
          schema:
            type: integer
        - name: Content-Type
          in: header
          description: '[Details](doc-341635)'
          required: true
          example: application/json
          schema:
            type: string
            default: application/json
            const: application/json
        - name: X-User-Agent
          in: header
          description: Arbitrary identifier of your client. [Details](doc-341635)
          required: true
          example: '{{X_USER_AGENT}}'
          schema:
            type: string
            default: '{{X_USER_AGENT}}'
        - name: X-Product-Name
          in: header
          description: API Product for API context. [Details](doc-341635)
          required: true
          example: '{{PRODUCT_NAME}}'
          schema:
            type: string
            default: '{{PRODUCT_NAME}}'
        - name: X-Loyalty-Club-Slug
          in: header
          description: LoyaltyClub for API context. [Details](doc-342138)
          required: false
          example: '{{LOYALTY_CLUB_SLUG}}'
          schema:
            type: string
            default: '{{LOYALTY_CLUB_SLUG}}'
        - name: X-Customer
          in: header
          description: Customer for API context.  [Details](doc-342139)
          required: false
          example: '{{CUSTOMER_ID}}'
          schema:
            type: string
            default: '{{CUSTOMER_ID}}'
        - name: Authorization
          in: header
          description: '[Member](doc-342129) or [User](doc-342130) Authorization.'
          required: false
          example: Bearer {{_OAUTH_TOKEN}}
          schema:
            type: string
            default: Bearer {{_OAUTH_TOKEN}}
        - name: X-Client-Authorization
          in: header
          description: '[Token](doc-342128) Authorization.'
          example: '{{API_TOKEN}}'
          schema:
            type: string
            default: '{{API_TOKEN}}'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                attachment: &ref_0
                  $ref: '#/components/schemas/Attachment'
              x-apidog-orders:
                - attachment
              required:
                - attachment
              x-apidog-ignore-properties: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  attachment: *ref_0
                x-apidog-orders:
                  - attachment
                required:
                  - attachment
                x-apidog-ignore-properties: []
              example:
                attachment:
                  id: 4
                  customer_id: 123
                  title: {}
                  file: null
                  locales: []
                  created_at: '2025-04-07T13:02:18.084354Z'
                  updated_at: '2025-04-07T13:02:18.084354Z'
          headers: {}
          x-apidog-name: Success
      security: []
      x-apidog-folder: API Reference/Management API/CMS/Extensions/Attachments
      x-apidog-status: released
      x-run-in-apidog: https://app.eu.apidog.com/web/project/346351/apis/api-3763870-run
components:
  schemas:
    Attachment:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/id'
        customer_id:
          $ref: '#/components/schemas/id.customer_id'
        locales:
          $ref: '#/components/schemas/cms.locales'
        title:
          anyOf:
            - $ref: '#/components/schemas/LocalizedContent'
            - type: 'null'
        file:
          anyOf:
            - $ref: '#/components/schemas/File'
            - type: 'null'
          description: 'Must be uploaded as a file of type: "cms_attachment"'
        created_at:
          $ref: '#/components/schemas/date_time.created_at'
        updated_at:
          $ref: '#/components/schemas/date_time.updated_at'
      x-apidog-orders:
        - id
        - customer_id
        - locales
        - title
        - file
        - created_at
        - updated_at
      required:
        - id
        - customer_id
        - locales
        - title
        - file
        - created_at
        - updated_at
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    date_time.updated_at:
      type: string
      description: Time of the last record update
      format: date-time
      examples:
        - '2022-11-15T16:25:58.099512Z'
      readOnly: true
      x-apidog-folder: ''
    date_time.created_at:
      type: string
      description: Time of record creation
      format: date-time
      examples:
        - '2022-11-05T16:25:58.099512Z'
      readOnly: true
      x-apidog-folder: ''
    File:
      type: object
      properties:
        url:
          type: string
          format: uri
          readOnly: true
          examples:
            - https://example.com/image.png
        identifier:
          type: string
          description: Only present when parent record has many files
          examples:
            - '1'
        mime_type:
          type: string
          examples:
            - image/jpeg
          readOnly: true
          description: Only present in certain circumstances
          nullable: true
        created_at:
          type: string
          format: date-time
          examples:
            - '2022-11-09T15:46:00.252860Z'
        updated_at:
          type: string
          format: date-time
          readOnly: true
          examples:
            - '2022-11-09T15:46:00.252860Z'
        image_details:
          type: object
          properties:
            width:
              type: integer
              minimum: 1
            height:
              type: integer
              minimum: 1
          x-apidog-orders:
            - width
            - height
          x-apidog-ignore-properties: []
          nullable: true
      x-apidog-orders:
        - url
        - identifier
        - mime_type
        - created_at
        - updated_at
        - image_details
      required:
        - url
        - created_at
        - updated_at
      readOnly: true
      x-apidog-ignore-properties: []
      nullable: true
      x-apidog-folder: ''
    LocalizedContent:
      type: object
      properties: {}
      x-apidog-orders: []
      title: ''
      examples:
        - en: Text
      additionalProperties:
        type: string
        description: >-
          The actual set of languages depends on LC configuration. See:
          [Localization](doc-341959)
        examples:
          - Tekst
        nullable: true
      x-apidog-ignore-properties: []
      nullable: true
      x-apidog-folder: ''
    cms.locales:
      type: array
      items:
        type: string
        examples:
          - test
      description: >-
        Locales the record should be available to - see:
        [Localization](doc-341959)
      examples:
        - - en
      x-apidog-orders: []
      x-apidog-folder: ''
    id.customer_id:
      type: integer
      format: uint64
      readOnly: true
      examples:
        - 447
      description: Customer the record is assigned to
      x-apidog-folder: ''
    id:
      type: integer
      description: Primary identifier of the record
      format: uint64
      readOnly: true
      examples:
        - 1
      x-apidog-folder: ''
  securitySchemes: {}
servers:
  - url: https://api.mpc.dev.placewise.com
    description: Staging
security: []

```