---
updatedAt: 2026-09-01T20:42:06.000Z
---

# Create a segment upload from file

Creates a new segment upload job by directly uploading a file. Accepts multipart/form-data for file upload. File must be in CSV or TSV format and under the maximum size limit. The system will validate the file format and content before processing.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Reference Resources",
    "version": "2.0.0",
    "description": "Buzz API v2"
  },
  "paths": {
    "/segment-uploads/file": {
      "post": {
        "operationId": "segment_uploads_file_create",
        "description": "Creates a new segment upload job by directly uploading a file. Accepts multipart/form-data for file upload. File must be in CSV or TSV format and under the maximum size limit. The system will validate the file format and content before processing.",
        "summary": "Create a segment upload from file",
        "tags": [
          "Segments"
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/SegmentUploadFile"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/SegmentUploadFile"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "nestSessionAuth": []
          },
          {
            "nestBasicAuth": []
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SegmentUploadFile"
                }
              }
            },
            "description": "Segment upload created successfully from uploaded file."
          },
          "400": {
            "description": "Validation error, or the request was not sent as multipart/form-data. An unsupported Content-Type is reported as a non-field validation error, not as a 415."
          },
          "401": {
            "description": "Authentication credentials were not provided."
          },
          "403": {
            "description": "Permission denied."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ContinentEnum": {
        "enum": [
          "NAM",
          "EMEA",
          "APAC"
        ],
        "type": "string",
        "description": "* `NAM` - NAM\n* `EMEA` - EMEA\n* `APAC` - APAC"
      },
      "KeyTypeEnum": {
        "enum": [
          "DEFAULT",
          "ALTERNATIVE"
        ],
        "type": "string",
        "description": "* `DEFAULT` - Default\n* `ALTERNATIVE` - Alternative"
      },
      "SegmentUploadFile": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "readOnly": true,
            "description": "The unique identifier for this segment upload."
          },
          "account_id": {
            "type": "integer",
            "description": "Defaults to the account in the active session"
          },
          "partner_handle": {
            "type": "string",
            "description": "Partner handle for sync partner configurations.",
            "maxLength": 20
          },
          "is_pii_segment": {
            "type": "boolean",
            "default": false,
            "description": "Whether this upload contains PII (Personally Identifiable Information) data."
          },
          "source": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SegmentUploadFileSource"
              }
            ],
            "description": "The uploaded file the user IDs are read from."
          },
          "segment": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SegmentUploadSegment"
              }
            ],
            "description": "Segment-specific configuration for the upload (continent, ID type, etc.)."
          },
          "create_date": {
            "type": "string",
            "readOnly": true,
            "nullable": true,
            "description": "The date and time the object was first created",
            "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$",
            "example": "2025-09-29 00:00:00"
          },
          "update_date": {
            "type": "string",
            "readOnly": true,
            "nullable": true,
            "description": "The date and time the object was last updated",
            "pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$",
            "example": "2025-09-29 00:00:00"
          },
          "upload_status": {
            "type": "string",
            "readOnly": true,
            "description": "Current status of the upload (e.g., 'PENDING', 'COMPLETE')."
          }
        },
        "required": [
          "account_id",
          "create_date",
          "id",
          "segment",
          "source",
          "update_date",
          "upload_status"
        ]
      },
      "SegmentUploadFileSource": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "readOnly": true,
            "description": "The uploaded file name."
          },
          "size": {
            "type": "integer",
            "readOnly": true,
            "description": "The uploaded file size in bytes."
          },
          "path": {
            "type": "string",
            "readOnly": true,
            "description": "Internal S3 path where the file is stored (set by backend)."
          },
          "format": {
            "type": "string",
            "description": "The anticipated file format."
          },
          "operation_type": {
            "type": "string",
            "description": "The action to be taken on the segments in the file(s)."
          },
          "file": {
            "type": "string",
            "format": "uri",
            "writeOnly": true,
            "description": "The file to upload (CSV or TSV format, must be under maximum size limit)."
          }
        },
        "required": [
          "file",
          "format",
          "name",
          "operation_type",
          "path",
          "size"
        ]
      },
      "SegmentUploadSegment": {
        "type": "object",
        "properties": {
          "continent": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ContinentEnum"
              }
            ],
            "description": "The continent for the segment upload.\n\n* `NAM` - NAM\n* `EMEA` - EMEA\n* `APAC` - APAC"
          },
          "key_type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/KeyTypeEnum"
              }
            ],
            "default": "DEFAULT",
            "description": "Whether user IDs map to segment key or alternative_id.\n\n* `DEFAULT` - Default\n* `ALTERNATIVE` - Alternative"
          },
          "user_id_type": {
            "type": "string",
            "description": "The type of IDs being imported.",
            "nullable": true
          },
          "first_party_user_id_type": {
            "type": "string",
            "nullable": true,
            "description": "Custom first-party user ID type (must be uppercase snake_case, e.g., 'CUSTOM_ID_TYPE').",
            "pattern": "^[A-Z]+(?:_[A-Z]+)*$",
            "maxLength": 191
          }
        },
        "required": [
          "continent"
        ]
      }
    },
    "securitySchemes": {
      "nestBasicAuth": {
        "type": "http",
        "scheme": "basic",
        "description": "Form-based Basic Authentication"
      },
      "nestSessionAuth": {
        "type": "http",
        "scheme": "basic",
        "description": "Form-based Basic Authentication"
      }
    }
  },
  "x-explorer-enabled": false,
  "x-samples-languages": [
    "curl",
    "node",
    "ruby",
    "javascript",
    "python",
    "php",
    "java"
  ],
  "servers": [
    {
      "url": "https://{buzz_key}.api.beeswax.com/rest/v2",
      "variables": {
        "buzz_key": {
          "default": "stingersbx",
          "description": "Unique customer ID assigned by the Beeswax"
        }
      }
    }
  ],
  "x-readme": {
    "apply-endpoint-order": true,
    "apply-tag-changes": true
  }
}
```