---
title: "Create File Subscription"
method: POST
path: "/fileSubscription"
tags: ["File Subscriptions"]
---

# Create File Subscription

`POST /fileSubscription`

## Request

- Base URL: `https://eu-west-1.api.silverflow.com/v1`
- URL: `https://eu-west-1.api.silverflow.com/v1/fileSubscription`
- Auth: one of:
  - HTTP basic
  - HTTP bearer
- TypeScript: <https://skmtc.dev/silverflow/apis/silverflow-api/docs/fileSubscription/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a new subscription based on the provided list of supported file types along with the `distributionKey`.

Note: Distributions configured for email deliveries are not supported.

Requires the `fileSubscription:Create` permission.

## Request body

- CreateFileSubscriptionRequest
  - `acquirerReferences` string[], required: Network-specific references for file routing. The type of reference required depends on the card network: | Card Network | Required Value | BIN Object Field | |-------------------|----------------|----------------------| | American Express | Submitter ID | acquirerIdCode | | Visa | Acquirer BIN | acquirerBin | | Mastercard | Acquirer BIN | acquirerBin | | Discover | Acquirer BIN | acquirerBin | These references are used to match incoming card network files to subscriptions.
  - `distributionKey` string, required: Key of the distribution where files will be sent.
  - `fileTypes` string[], required: List of card network file types to subscribe to. Each file type represents a specific format of raw data files from different card networks.
  - `publicKey` string, required: ASCII-armored PGP public key for file encryption. Supported algorithms: RSA (2048+ bits), Ed25519, ECDSA.

## Response `201`

The created file subscription

- FileSubscription
  - `subscriptionKey` string, required: The key of a subscription.
  - `agentKey` string, required: The key of an agent.
  - `acquirerReferences` string[], required: Network-specific references for file routing. The type of reference required depends on the card network: | Card Network | Required Value | BIN Object Field | |-------------------|----------------|----------------------| | American Express | Submitter ID | acquirerIdCode | | Visa | Acquirer BIN | acquirerBin | | Mastercard | Acquirer BIN | acquirerBin | | Discover | Acquirer BIN | acquirerBin | These references are used to match incoming card network files to subscriptions.
  - `distributionKey` string, required: Key of the distribution where files will be sent.
  - `fileTypes` string[], required: List of card network file types to subscribe to. Each file type represents a specific format of raw data files from different card networks.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `409`: Conflict
- `500`: Internal Server Error

---

[API](https://skmtc.dev/silverflow/apis/silverflow-api.md) - [All operations](https://skmtc.dev/silverflow/apis/silverflow-api/llms.txt) - [OpenAPI document](https://skmtc.dev/silverflow/apis/silverflow-api/revisions/43ecbe4fd6ea?raw)
