Skip to main content

Upload Contacts CSV

POST/api/v1/s3/presigned-upload-url

Generate a presigned PUT URL for direct CSV file upload to S3/MinIO. This endpoint enables browser-to-storage uploads without passing through the backend Access Control: * All authenticated users can upload CSV files scoped to their organization. * Files are stored with organization-scoped keys for multi-tenancy. Returns: * upload_url: Presigned URL (valid for 15 minutes) for PUT request * file_key: Unique storage key to use as source_id in campaign creation * expires_in: URL expiration time in seconds

cURL example

curl -X POST \
  'https://app.intracord.hu/api/v1/s3/presigned-upload-url' \
  -H "X-API-Key: $INTRACORD_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-binary @request.json

Parameters

NameLocationTypeDescription
authorizationheaderobject
X-API-Keyheaderobject

Request body

application/json
View schema
{
  "properties": {
    "file_name": {
      "type": "string",
      "pattern": ".*\\.csv$",
      "title": "File Name",
      "description": "CSV filename"
    },
    "file_size": {
      "type": "integer",
      "maximum": 10485760,
      "exclusiveMinimum": 0,
      "title": "File Size",
      "description": "File size in bytes (max 10MB)"
    },
    "content_type": {
      "type": "string",
      "title": "Content Type",
      "description": "File content type",
      "default": "text/csv"
    }
  },
  "type": "object",
  "required": [
    "file_name",
    "file_size"
  ],
  "title": "PresignedUploadUrlRequest"
}

Responses

200Successful Response
application/json
View schema
{
  "properties": {
    "upload_url": {
      "type": "string",
      "title": "Upload Url"
    },
    "file_key": {
      "type": "string",
      "title": "File Key"
    },
    "expires_in": {
      "type": "integer",
      "title": "Expires In"
    }
  },
  "type": "object",
  "required": [
    "upload_url",
    "file_key",
    "expires_in"
  ],
  "title": "PresignedUploadUrlResponse"
}
404Not found
422Validation Error
application/json
View schema
{
  "properties": {
    "detail": {
      "items": {
        "$ref": "#/components/schemas/ValidationError"
      },
      "type": "array",
      "title": "Detail"
    }
  },
  "type": "object",
  "title": "HTTPValidationError"
}