Update file headers

Overview

Update an existing file-header configuration. Here the {fileHeaderId} path segment is the file-header ID (campaign_automation_file_headers.id). The endpoint updates only the fields supplied; a new sample_file replaces and deletes the previous S3 object. Sent as multipart/form-data. Emits an audit event (CAMPAIGN_FILE_HEADERS_UPDATED).

Prerequisites

  • A bearer token in the Authorization header.
  • The fileHeaderId of the record you are targeting.

Base URL

EnvironmentURL
Productionhttps://production-api.shoutaboutus.com
Developmenthttps://development-api.shoutaboutus.com

Endpoint

PUT /api/v1/campaign/automate/file-headers/{fileHeaderId}

Authentication

  • Requires a bearer token in the Authorization: Bearer <bearer-token> header.

  • Account bearer. The owning campaign must belong to the caller's person.company_id and be of type automation, else 403.

Rate limit

  • No rate limit.

Path parameters

FieldTypeRequiredDescription
fileHeaderIdintegerRequiredThe file-header id (route constrained to [0-9]+).

Request body

FieldTypeRequiredDescription
headersstring (JSON)Optional`nullable
sample_filefileOptionalmimes:xlsx,xls,csv, max 10 MB.
location_identifierstringOptionalMax 255.

How it works

  • 200 with the refreshed row under data.data.
  • 400 if headers is provided but malformed / missing keys / non-string values.
  • 403 if the caller does not own the config's campaign or is not an automation campaign.
  • 404 if no file-header row matches {fileHeaderId}.

Response

200 OK · 200

{
  "data": {
    "status": "success",
    "message": "File headers updated successfully",
    "data": {
      "id": 4,
      "rs_campaign_id": 12,
      "headers": {
        "email": "Email Address",
        "phone": "Phone Number",
        "customer_name": "Customer Name",
        "location_identifier": "Store ID"
      },
      "sample_file_path": "campaign_automation/sample_files/1718447400_sample.xlsx",
      "location_identifier": "Store ID",
      "created_at": "2026-06-15T10:30:00.000000Z",
      "updated_at": "2026-06-15T10:30:00.000000Z"
    }
  }
}

400 Invalid headers · 400

{
  "message": "Bad Request",
  "status": "error",
  "errors": {
    "headers": [
      "Headers must contain all required keys: Email field mapping"
    ]
  }
}

403 Not authorized · 403

{
  "message": "Not authorized to update this file header configuration",
  "status": "error",
  "errors": []
}

404 Not found · 404

{
  "message": "File header configuration not found",
  "status": "error",
  "errors": []
}

Errors

StatusMeaning
400Invalid headers
401The bearer token is missing, expired or invalid
403Not authorized
404Not found
422The request failed validation — the response names the fields
500Unexpected server error

Example request

curl --request PUT \
  --url "https://production-api.shoutaboutus.com/api/v1/campaign/automate/file-headers/123" \
  --header 'Authorization: Bearer <bearer-token>' \
  --header 'Accept: application/json' \
  --form 'headers={"email":"Email Address","phone":"Phone Number","customer_name":"Customer Name","location_identifier":"Store ID"}' \
  --form 'sample_file=@sample_file.xlsx' \
  --form 'location_identifier=Store ID'

Did this page help you?