---
title: "Remove an attachment"
method: POST
path: "/accounts/email-template-attachment-remove"
tags: ["Email Templates"]
---

# Remove an attachment

`POST /accounts/email-template-attachment-remove`

## Request

- Base URL: `https://api.quiva.ai`
- URL: `https://api.quiva.ai/accounts/email-template-attachment-remove`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/quivaworks/apis/quiva-ai-gateway/docs/accounts/email-template-attachment-remove/post.ts> (a function with typed inputs; its response is checked against the schema)

Removes the attached file whose key is `file_key` from the draft.

## Request body

- EmailTemplateAttachmentRequest
  - `key` string, required: Template key
  - `bucket` string: Bucket to copy the file from (add only)
  - `file_key` string, required: File to add, or the attached file to remove
  - `filename` string

## Response `200`

Success

- object
  - `data` EmailTemplate, required: One per account and key. A template holds a draft and a published version.
    - `key` string: Slug that flows and Abbie reference. Never changes after creation.
    - `name` string
    - `description` string
    - `draft` EmailTemplateVersion
      - `subject` string
      - `html` string
      - `text` string: Derived from the HTML at render time when empty
      - `notes` string
      - `data` EmailTemplateData: Record data a template merges. The caller loads it; a declared tag with no value renders blank.
        - `record_configs` string[]: Whole record sets by config id
        - `fields` string[]: Exact `<config id>.<payload path>` fields
      - `attachments` EmailTemplateAttachment[]
        - `key` string
        - `filename` string: May hold {tags}
        - `size` integer
        - `type` string
      - `saved_at` string, date-time
      - `saved_by` string
    - `published` EmailTemplateVersion
      - `subject` string
      - `html` string
      - `text` string: Derived from the HTML at render time when empty
      - `notes` string
      - `data` EmailTemplateData: Record data a template merges. The caller loads it; a declared tag with no value renders blank.
        - `record_configs` string[]: Whole record sets by config id
        - `fields` string[]: Exact `<config id>.<payload path>` fields
      - `attachments` EmailTemplateAttachment[]
        - `key` string
        - `filename` string: May hold {tags}
        - `size` integer
        - `type` string
      - `saved_at` string, date-time
      - `saved_by` string
    - `data` EmailTemplateData: Record data a template merges. The caller loads it; a declared tag with no value renders blank.
      - `record_configs` string[]: Whole record sets by config id
      - `fields` string[]: Exact `<config id>.<payload path>` fields
    - `sample_data` object: What the preview renders against
    - `tags` string[]: Every {tag} in the draft's subject, html and text
    - `source` 'abbie' | 'api'
    - `created_at` string, date-time
    - `updated_at` string, date-time
    - `updated_by` string
    - `published_at` string, date-time
    - `published_by` string

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found

## Changes

- **2026-11-12** `700eb1ace61a`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway/changes/accounts/email-template-attachment-remove/post.md)

---

[API](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway.md) - [All operations](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway/llms.txt) - [OpenAPI document](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway/revisions/700eb1ace61a?raw)
