Skip to content

Import subscriptions

POST
/api/v1/import
curl --request POST \
--url http://127.0.0.1:8484/api/v1/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "allowDuplicates": true, "dryRun": true, "items": [ { "account": "example", "altPrice": "example", "altUnit": "month", "autoConfirm": true, "cancelUrl": "example", "category": "example", "currency": "example", "dayRule": "day", "endDate": "example", "interval": 1, "name": "example", "nextCharge": "example", "notes": "example", "noticeDays": 1, "payer": "example", "paymentMethod": "example", "price": "example", "remark": "example", "reminderDays": [ 1 ], "renewal": "auto", "startedOn": "example", "status": "active", "tags": [ "example" ], "trialEndsOn": "example", "unit": "day", "url": "example", "weekendShift": "none" } ] }'

Creates many subscriptions in one step, e.g. from a bank statement, a spreadsheet or another app. Categories, payment methods and payers are given by name (missing categories and payment methods are created). Items that duplicate an existing subscription or fail validation are skipped and reported. Always call it first with dryRun and show the user the list.

Media typeapplication/json
object
$schema

A URL to the JSON Schema for this object.

string format: uri
allowDuplicates
boolean
dryRun
boolean
items
required
Array<object> | null
object
account
string
altPrice
string
altUnit
string
Allowed values: month year
autoConfirm
boolean
cancelUrl
string
category
string
currency
string
dayRule
string
Allowed values: day weekday last-weekday
endDate
string
interval
integer format: int64
name
required
string
nextCharge
string
notes
string
noticeDays
integer format: int64
payer
string
paymentMethod
string
price
required
string
remark
string
reminderDays
Array<integer> | null
renewal
string
Allowed values: auto manual
startedOn
string
status
string
Allowed values: active paused cancelled
tags
Array<string> | null
trialEndsOn
string
unit
string
Allowed values: day week month year
url
string
weekendShift
string
Allowed values: none next previous

OK

Media typeapplication/json
object
$schema

A URL to the JSON Schema for this object.

string format: uri
created
required
integer format: int64
dryRun
boolean
duplicates
required
integer format: int64
errors
required
integer format: int64
items
required
Array<object> | null
object
action
required
string
Allowed values: create duplicate error
id
string
message
string
name
required
string
newCategories
required
Array<string> | null
newPaymentMethods
required
Array<string> | null

Example

{
"$schema": "https://example.com/api/schemas/ImportResult.json",
"items": [
{
"action": "create"
}
]
}

Error

Media typeapplication/problem+json
object
$schema

A URL to the JSON Schema for this object.

string format: uri
detail

A human-readable explanation specific to this occurrence of the problem.

string
errors

Optional list of individual error details

Array<object> | null
object
location

Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’

string
message

Error message text

string
value

The value at the given location

instance

A URI reference that identifies the specific occurrence of the problem.

string format: uri
status

HTTP status code

integer format: int64
title

A short, human-readable summary of the problem type. This value should not change between occurrences of the error.

string
type

A URI reference to human-readable documentation for the error.

string format: uri
default: about:blank

Example

{
"$schema": "https://example.com/api/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}