---
updatedAt: 2026-09-04T07:06:48.000Z
agentTools:
  projectIndex: https://documentation.indigitall.com/llms.txt
---

# Create attachment

Create a new attachment. The fields required to call this endpoint are, file (here the file to upload will go), campaignId (this refers to the id of the campaign to which we want to associate the attachment).

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "version": "2.0.0",
    "title": "INDIGITALL API",
    "x-logo": {
      "url": "https://console.indigitall.com/images/logo_verdeblanco@2x.png",
      "backgroundColor": "#0F3B7A"
    },
    "description": "\n### Introduction:\nThis documentation describes every endpoint of Indigitall's API v2\n\nAPI BASE URL: https://api.indigitall.com/v2\n\n### Authentication:\n\nMost of the endpoints of the API needs an Authorization header.\n\nThere are two Authorization ways:\n\n- If your intention is to manage API calls with a server-side script you have to create a Server key through Indigitall's console.\n\n  You can set the following Authorization Header : 'Authorization: ServerKey {ServerKey}'\n- If your intention is to integrate this API for front-end users POST /auth endpoint authorizes a user and returns an access token.\n\n  You can set the following Authorization Header : 'Authorization: Bearer {Token}'\n"
  },
  "security": [
    {
      "Authorization": []
    }
  ],
  "tags": [
    {
      "name": "es-attachment",
      "x-displayName": "Email - Campaign attachments",
      "description": "Endpoints for manage campaign attachments"
    }
  ],
  "x-tagGroups": [
    {
      "name": "Chat Service",
      "tags": [
        "chat-configuration",
        "chat-channel",
        "chat-contact",
        "chat-integration",
        "chat-task",
        "chat-campaign",
        "chat-send",
        "chat-multimedia",
        "chat-slicing",
        "chat-tag",
        "chat-contact-list",
        "chat-cc-agent",
        "chat-cc-permissions-profile",
        "chat-cc-weekly-schedule",
        "chat-cc-special-days-schedule",
        "chat-cc-conversation",
        "chat-cc-agent-group",
        "chat-cc-contact-comment",
        "chat-cc-form",
        "chat-stats",
        "chat-internal"
      ]
    },
    {
      "name": "Customer Service",
      "tags": [
        "customer-service-adviser",
        "customer-service-customer",
        "customer-service-customer-csv",
        "customer-service-customer-field",
        "customer-service-customer-journey",
        "customer-service-customer-journey-template",
        "customer-service-customer-journey-control",
        "customer-service-customer-send",
        "customer-service-stats",
        "customer-service-webhook-template",
        "customer-service-segment",
        "customer-service-audience",
        "customer-service-application",
        "customer-service-journeywaitqueue",
        "customer-service-task",
        "customer-service-cdpeventtype",
        "customer-service-cdpeventtypetemplate",
        "customer-service-internal"
      ]
    },
    {
      "name": "Email Service",
      "tags": [
        "es-configuration",
        "es-configurationDomain",
        "es-configurationDomainEmail",
        "es-footer",
        "es-audience",
        "es-contact",
        "es-category",
        "es-campaign",
        "es-campaign-block",
        "es-campaign block-column",
        "es-campaign-multimedia",
        "es-shipment",
        "es-attachment",
        "es-statistics",
        "es-webhook",
        "es-tasks"
      ]
    },
    {
      "name": "InApp Service",
      "tags": [
        "inapp-configuration",
        "inapp-campaign",
        "inapp-schema",
        "inapp-topic",
        "inapp-multimedia",
        "inapp-form",
        "inapp-stats",
        "inapp-audience",
        "inapp-task"
      ]
    },
    {
      "name": "SMS Service",
      "tags": [
        "sms-campaign",
        "sms-configuration",
        "sms-contact",
        "sms-send",
        "sms-stats",
        "sms-topic",
        "sms-cost",
        "sms-webhook",
        "sms-private"
      ]
    },
    {
      "name": "Wallet Service",
      "tags": [
        "wallet-project",
        "wallet-images",
        "wallet-tasks",
        "wallet-notifications",
        "wallet-template",
        "wallet-loyalty-pass",
        "wallet-loyalty-template",
        "wallet-offer-pass",
        "wallet-offer-template",
        "wallet-generic-pass",
        "wallet-generic-template"
      ]
    },
    {
      "name": "Stats Service",
      "tags": [
        "stats-service-chat",
        "stats-service-cs",
        "stats-service-report",
        "stats-service-wallet",
        "stats-service-meta"
      ]
    },
    {
      "name": "ChatGen service",
      "tags": [
        "icc-chatgen-gateway-agent",
        "icc-chatgen-gateway-api-tool",
        "icc-chatgen-gateway-configured-custom-tool",
        "icc-chatgen-gateway-conversation",
        "icc-chatgen-gateway-custom-tool",
        "icc-chatgen-gateway-document",
        "icc-chatgen-gateway-file",
        "icc-chatgen-gateway-instance-config",
        "icc-chatgen-gateway-router-agent-tool",
        "icc-chatgen-gateway-router-agent"
      ]
    },
    {
      "name": "AI Assitant service",
      "tags": [
        "ai-generator-campaign"
      ]
    },
    {
      "name": "Meta Service",
      "tags": [
        "meta-cloudapi",
        "meta-configuration",
        "meta-webhook",
        "meta-business",
        "meta-templates",
        "meta-upload"
      ]
    },
    {
      "name": "Push Live Service",
      "tags": [
        "push-live-configuration",
        "push-live-ios-class",
        "push-live-activity",
        "push-live-send"
      ]
    },
    {
      "name": "Pathbot",
      "tags": [
        "pathbot-agents",
        "pathbot-applications",
        "pathbot-documents",
        "pathbot-flows",
        "pathbot-tools",
        "pathbot-nodes",
        "pathbot-ingestion-sources",
        "pathbot-evaluation",
        "pathbot-skills"
      ]
    },
    {
      "name": "Link Service",
      "tags": [
        "link-short-domain"
      ]
    }
  ],
  "servers": [
    {
      "url": "https://api.indigitall.com/v2"
    }
  ],
  "paths": {
    "/email/attachment": {
      "post": {
        "tags": [
          "es-attachment"
        ],
        "summary": "Create attachment",
        "description": "Create a new attachment. The fields required to call this endpoint are, file (here the file to upload will go), campaignId (this refers to the id of the campaign to which we want to associate the attachment).",
        "x-eov-operation-handler": "attachmentController",
        "operationId": "emailPostAttachment",
        "x-gateway-endpoint": "emailService",
        "x-gateway-check-permission": {
          "account-features": [
            "EMAIL_ENABLED"
          ]
        },
        "requestBody": {
          "$ref": "#/components/requestBodies/ES_AttachmentRequestBody"
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/ES_AttachmentResponse"
          },
          "400": {
            "$ref": "#/components/responses/ES_ParameterMissingOrInvalidResponse"
          },
          "401": {
            "$ref": "#/components/responses/ES_ErrorAppKeyResponse"
          },
          "403": {
            "$ref": "#/components/responses/ES_ForbiddenErrorResponse"
          },
          "409": {
            "$ref": "#/components/responses/ES_ForeingKeyConstrintErrorResponse"
          },
          "500": {
            "$ref": "#/components/responses/ES_ServerErrorResponse"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "Authorization": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "Authorization for accesing endpoints , must be in one of the following format:\n- **Bearer {token}**\n- **ServerKey {key}**\n"
      }
    },
    "schemas": {
      "ES_ErrorSchema": {
        "required": [
          "message",
          "statusCode"
        ],
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "integer",
            "description": "Response code"
          },
          "errorCode": {
            "type": "string",
            "enum": [
              "ES_ATTACHMENT_NOT_FOUND",
              "ES_SHIPMENT_SCHEDULED",
              "ES_SHIPMENT_HAVE_VARS",
              "ES_CAMPAIGN_NOT_FOUND",
              "ES_CAMPAIGN_NOT_MODIFIABLE",
              "ES_CAMPAIGN_TEMPLATE_NOT_FOUND",
              "ES_CAMPAIGN_SENT",
              "ES_CAMPAIGN_MULTIMEDIA_NOT_FOUND",
              "ES_CAMPAIGN_HTML_NOT_FOUND",
              "ES_CAMPAIGN_BLOCK_NOT_FOUND",
              "ES_CAMPAIGN_BLOCK_COLUMN_NOT_FOUND",
              "ES_CAMPAIGN_BLOCK_COLUMN_TYPE_ERROR",
              "ES_COLUMNS_IN_BLOCK_LIMIT",
              "ES_CONFIGURATION_ALREADY_EXISTS",
              "ES_CONFIGURATION_NOT_FOUND",
              "ES_CONFIGURATION_ERROR_MAILJET",
              "ES_CONFIGURATION_DOMAIN_NOT_FOUND",
              "ES_CONFIGURATION_DOMAIN_IN_USE",
              "ES_CONFIGURATION_DOMAIN_EMAIL_NOT_FOUND",
              "ES_CONFIGURATION_DOMAIN_EMAIL_IN_USE",
              "ES_CONTACT_NOT_FOUND",
              "ES_CATEGORY_NOT_FOUND",
              "ES_CATEGORY_IN_USE",
              "ES_APPLICATION_NOT_FOUND",
              "ES_FOOTER_NOT_FOUND",
              "ES_FOOTER_TITLE_EXISTS",
              "ES_FOOTER_IN_USE",
              "ES_SHIPMENT_NOT_FOUND",
              "ES_CONFLICT",
              "ES_ACCESS_FORBIDDEN",
              "ES_AUDIENCE_CJ_NOT_FOUND"
            ],
            "description": "* `ES_ATTACHMENT_NOT_FOUND` - Attachment not found\n* `ES_SHIPMENT_SCHEDULED` - Shipment has been scheduled\n* `ES_SHIPMENT_HAVE_VARS` - Sending variables is not allowed in massive mailing.\n* `ES_CAMPAIGN_NOT_FOUND` - Campaign not found\n* `ES_CAMPAIGN_NOT_MODIFIABLE` - Campaign cannot be updated as it belongs to an initialized journey\n* `ES_CAMPAIGN_TEMPLATE_NOT_FOUND` - Campaign template not found\n* `ES_CAMPAIGN_SENT` - Campaign has been send\n* `ES_CAMPAIGN_MULTIMEDIA_NOT_FOUND` - Campaign multimedia not found\n* `ES_CAMPAIGN_HTML_NOT_FOUND` - Campaign html not found\n* `ES_CAMPAIGN_BLOCK_NOT_FOUND` - Campaign block not found\n* `ES_CAMPAIGN_BLOCK_COLUMN_NOT_FOUND` - Campaign block column not found * `ES_CAMPAIGN_BLOCK_COLUMN_TYPE_ERROR` - The parameters of the block column are not correct for this type * `ES_COLUMNS_IN_BLOCK_LIMIT` - The column limit for this block has been exceeded\n* `ES_CONFIGURATION_ALREADY_EXISTS` - Configuration already exists for application * `ES_CONFIGURATION_NOT_FOUND` - Configuration not found * `ES_CONFIGURATION_ERROR_MAILJET` - Error Mailjet Api\n* `ES_CONFIGURATION_DOMAIN_NOT_FOUND` - Configuration domain not found\n* `ES_CONFIGURATION_DOMAIN_IN_USE` - Configuration domain in use\n* `ES_CONFIGURATION_DOMAIN_EMAIL_NOT_FOUND` - Configuration domain email not found\n* `ES_CONFIGURATION_DOMAIN_EMAIL_IN_USE` - Configuration domain email in use\n* `ES_CONTACT_NOT_FOUND` - Contact not found\n* `ES_CATEGORY_NOT_FOUND` - Category not found\n* `ES_CATEGORY_IN_USE` - Category in use\n* `ES_APPLICATION_NOT_FOUND` - Application not found\n* `ES_FOOTER_NOT_FOUND` - Footer not found\n* `ES_FOOTER_IN_USE` - Footer in use\n* `ES_FOOTER_TITLE_EXISTS` - Footer title exists\n* `ES_SHIPMENT_NOT_FOUND` - Shipment not found\n* `ES_CONFLICT` - Unique contraint error\n* `ES_ACCESS_FORBIDDEN` - Access forbidden for user\n* `ES_AUDIENCE_CJ_NOT_FOUND` - The referenced Customer Journey (CJ) audience/segment was not found\n"
          },
          "message": {
            "type": "string",
            "description": "Error message"
          }
        }
      },
      "ES_ErrorAppKeySchema": {
        "required": [
          "data",
          "message",
          "statusCode"
        ],
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "integer",
            "description": "Response code"
          },
          "message": {
            "type": "string",
            "description": "Error message"
          },
          "data": {
            "type": "object",
            "properties": {},
            "description": "Error data"
          }
        }
      },
      "ES_AttachmentSchema": {
        "additionalProperties": false,
        "required": [
          "id",
          "campaignId",
          "fileName",
          "originalFileName"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "description": "Unique identifier for the attachment.",
            "example": 12345
          },
          "campaignId": {
            "type": "integer",
            "format": "int64",
            "description": "Identifier of the associated campaign.",
            "example": 67890
          },
          "fileName": {
            "type": "string",
            "description": "Name of the file as it is stored in the storage system (e.g., in cloud storage or a database).",
            "example": "campaign_report_2025.pdf"
          },
          "originalFileName": {
            "type": "string",
            "description": "The original name of the uploaded file provided by the user.",
            "example": "campaign_report.pdf"
          }
        }
      },
      "ES_AttachmentRequestSchema": {
        "required": [
          "campaignId",
          "file"
        ],
        "type": "object",
        "properties": {
          "campaignId": {
            "type": "string",
            "format": "int64",
            "description": "Identifier of the campaign to associate the attachment with.",
            "example": 67890
          },
          "name": {
            "type": "string",
            "description": "(Optional) The name of the file, including its extension.\nIf not provided, the original name of the uploaded file will be used.\n",
            "example": "custom_name_report.pdf"
          },
          "file": {
            "type": "string",
            "format": "binary",
            "description": "Binary data representing the file to be uploaded (e.g., a PDF, image, or text file)."
          }
        }
      }
    },
    "responses": {
      "ES_ServerErrorResponse": {
        "description": "Server error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ES_ErrorSchema"
            },
            "example": {
              "statusCode": 500,
              "errorCode": "ES_SERVER_ERROR",
              "message": "Server error"
            }
          }
        }
      },
      "ES_ErrorAppKeyResponse": {
        "description": "App key is not valid",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ES_ErrorAppKeySchema"
            },
            "example": {
              "statusCode": 401,
              "errorCode": "ES_APP_KEY_IS_NOT_VALID",
              "message": "App key is not valid"
            }
          }
        }
      },
      "ES_ParameterMissingOrInvalidResponse": {
        "description": "Parameter is missing or invalid",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ES_ErrorSchema"
            },
            "example": {
              "statusCode": 400,
              "errorCode": "ES_PARAMETER_MISSING_OR_INVALID",
              "message": "Parameter is missing or invalid"
            }
          }
        }
      },
      "ES_ForeingKeyConstrintErrorResponse": {
        "description": "Conflict",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ES_ErrorSchema"
            },
            "example": {
              "statusCode": 409,
              "errorCode": "ES_FOREING_KEY_CONSTRINT_ERROR",
              "message": "Conflict"
            }
          }
        }
      },
      "ES_ForbiddenErrorResponse": {
        "description": "Access Forbidden",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ES_ErrorSchema"
            },
            "example": {
              "statusCode": 403,
              "errorCode": "ES_ACCESS_FORBIDDEN",
              "message": "Access Forbidden"
            }
          }
        }
      },
      "ES_AttachmentResponse": {
        "description": "OK",
        "content": {
          "application/json": {
            "schema": {
              "required": [
                "statusCode",
                "message",
                "data"
              ],
              "type": "object",
              "properties": {
                "statusCode": {
                  "type": "integer",
                  "description": "Response code",
                  "example": 200
                },
                "message": {
                  "type": "string",
                  "description": "Response message, usually OK",
                  "example": "OK"
                },
                "data": {
                  "$ref": "#/components/schemas/ES_AttachmentSchema"
                }
              }
            }
          }
        }
      }
    },
    "requestBodies": {
      "ES_AttachmentRequestBody": {
        "required": true,
        "content": {
          "multipart/form-data": {
            "schema": {
              "$ref": "#/components/schemas/ES_AttachmentRequestSchema"
            }
          }
        }
      }
    }
  }
}
```