Skip to content

Preview or approve automatic purchase permission

POST
/v1/account/automatic-purchases
curl --request POST \
--url https://api.infiniteaudience.ai/v1/account/automatic-purchases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "action": "preview", "scopes": [ { "provider": "hubspot", "connection_id": "example", "selected_fields": [ "example" ] } ], "max_records_per_period": 1, "max_charge_cents_per_period": 1, "expires_at": "2026-04-15T12:00:00Z" }'

Requires ‘creator’ scope. Requires an owner or admin. Approve only new-licence purchases for selected HubSpot/Klaviyo integrations, with pooled record and spending limits per actual payer billing period. Preview does not purchase. Approval requires the reviewed revision, current terms fingerprint and stable request ID. Does not authorize renewals or destination charges. Controls remain subject to rollout availability. Each Shopify store manages its separate permission in its embedded app.

Media typeapplication/json
One of:
object
action
required
string
Allowed value: preview
scopes
required
Array
>= 1 items <= 50 items
object
provider
required
string
Allowed values: shopify hubspot klaviyo
connection_id
required
string
>= 1 characters <= 240 characters
selected_fields
required
Array<string>
>= 1 items
provider
required
string
Allowed values: hubspot klaviyo
max_records_per_period
required
integer
>= 1 <= 100000000
max_charge_cents_per_period
required
integer
>= 1 <= 9007199254740991
expires_at
string | null format: date-time

Current permission or a non-purchasing preview.

Media typeapplication/json
One of:
object
authorization
required
One of:
object
version
required
integer
Allowed value: 1
org_id
required
string
enabled
required
boolean
revision
required
string
billing_terms_fingerprint
required
string
scopes
required
Array<object>
>= 1 items <= 50 items
object
provider
required
string
Allowed values: shopify hubspot klaviyo
connection_id
required
string
>= 1 characters <= 240 characters
selected_fields
required
Array<string>
>= 1 items
max_records_per_period
required
integer
>= 1 <= 100000000
max_charge_cents_per_period
required
integer
>= 1 <= 9007199254740991
expires_at
required
string | null format: date-time
approved_by
required
string
approved_at
required
string format: date-time
revoked_by
required
string | null
revoked_at
required
string | null format: date-time
Example
{
"authorization": {
"version": 1,
"scopes": [
{
"provider": "shopify"
}
]
}
}

Invalid request — malformed body, missing required attribute, or failed validation. See error and message for details.

Media typeapplication/json
object
error
required

Stable machine-readable error code (e.g. INVALID_STATUS_TRANSITION, BILLING_INSUFFICIENT_BALANCE). Always present.

string
message

Human-readable explanation of the error.

string
code

Alternate machine-readable code — present on some endpoints as an alias for error for backward compatibility.

string
request_id

Opaque support/debug identifier when available.

string
next_step

Public action for correcting the request or retrying later.

string
issues
Array<object>
object
path
required

JSON path to the invalid filter field or value.

string
code
required
string
Allowed values: INVALID_FILTER_SHAPE UNKNOWN_FILTER_FIELD FIELD_NOT_FILTERABLE UNSUPPORTED_FILTER_OPERATOR UNSUPPORTED_TEXT_COMPARISON INVALID_FILTER_VALUE INVALID_ENUM_VALUE AMBIGUOUS_ENUM_VALUE
message
required
string
suggestions
Array<string>
key
additional properties
any
Examples
Examplevalidation_error
{
"error": "Bad Request",
"code": "MISSING_SEGMENTS",
"message": "segment_ids is required for filter audiences."
}

Missing or invalid Bearer token. Obtain one via POST /v1/auth/token. When a token was supplied but rejected, code distinguishes TOKEN_EXPIRED (the token’s lifetime has passed — request a new one via POST /v1/auth/token and retry) from TOKEN_INVALID (malformed or revoked — re-authenticate).

Media typeapplication/json
object
error
required

Stable machine-readable error code (e.g. INVALID_STATUS_TRANSITION, BILLING_INSUFFICIENT_BALANCE). Always present.

string
message

Human-readable explanation of the error.

string
code

Alternate machine-readable code — present on some endpoints as an alias for error for backward compatibility.

string
request_id

Opaque support/debug identifier when available.

string
next_step

Public action for correcting the request or retrying later.

string
issues
Array<object>
object
path
required

JSON path to the invalid filter field or value.

string
code
required
string
Allowed values: INVALID_FILTER_SHAPE UNKNOWN_FILTER_FIELD FIELD_NOT_FILTERABLE UNSUPPORTED_FILTER_OPERATOR UNSUPPORTED_TEXT_COMPARISON INVALID_FILTER_VALUE INVALID_ENUM_VALUE AMBIGUOUS_ENUM_VALUE
message
required
string
suggestions
Array<string>
key
additional properties
any
Examples
{
"error": "Unauthorized: Missing or invalid Authorization header"
}

Token is valid but lacks the required scope for this endpoint. Check the endpoint description for the required scope (discovery, purchase, or account).

Media typeapplication/json
object
error
required

Stable machine-readable error code (e.g. INVALID_STATUS_TRANSITION, BILLING_INSUFFICIENT_BALANCE). Always present.

string
message

Human-readable explanation of the error.

string
code

Alternate machine-readable code — present on some endpoints as an alias for error for backward compatibility.

string
request_id

Opaque support/debug identifier when available.

string
next_step

Public action for correcting the request or retrying later.

string
issues
Array<object>
object
path
required

JSON path to the invalid filter field or value.

string
code
required
string
Allowed values: INVALID_FILTER_SHAPE UNKNOWN_FILTER_FIELD FIELD_NOT_FILTERABLE UNSUPPORTED_FILTER_OPERATOR UNSUPPORTED_TEXT_COMPARISON INVALID_FILTER_VALUE INVALID_ENUM_VALUE AMBIGUOUS_ENUM_VALUE
message
required
string
suggestions
Array<string>
key
additional properties
any
Examples
Examplemissing_scope
{
"error": "SCOPE_REQUIRED",
"message": "This endpoint requires the creator scope."
}

Resource state conflicts with the request. For upload analysis this includes FILE_NOT_YET_UPLOADED.

Media typeapplication/json
object
error
required

Stable machine-readable error code (e.g. INVALID_STATUS_TRANSITION, BILLING_INSUFFICIENT_BALANCE). Always present.

string
message

Human-readable explanation of the error.

string
code

Alternate machine-readable code — present on some endpoints as an alias for error for backward compatibility.

string
request_id

Opaque support/debug identifier when available.

string
next_step

Public action for correcting the request or retrying later.

string
issues
Array<object>
object
path
required

JSON path to the invalid filter field or value.

string
code
required
string
Allowed values: INVALID_FILTER_SHAPE UNKNOWN_FILTER_FIELD FIELD_NOT_FILTERABLE UNSUPPORTED_FILTER_OPERATOR UNSUPPORTED_TEXT_COMPARISON INVALID_FILTER_VALUE INVALID_ENUM_VALUE AMBIGUOUS_ENUM_VALUE
message
required
string
suggestions
Array<string>
key
additional properties
any
Example
{
"issues": [
{
"code": "INVALID_FILTER_SHAPE"
}
]
}

A required billing provider partnership is temporarily unavailable.

Media typeapplication/json
object
error
required

Stable machine-readable error code (e.g. INVALID_STATUS_TRANSITION, BILLING_INSUFFICIENT_BALANCE). Always present.

string
message

Human-readable explanation of the error.

string
code

Alternate machine-readable code — present on some endpoints as an alias for error for backward compatibility.

string
request_id

Opaque support/debug identifier when available.

string
next_step

Public action for correcting the request or retrying later.

string
issues
Array<object>
object
path
required

JSON path to the invalid filter field or value.

string
code
required
string
Allowed values: INVALID_FILTER_SHAPE UNKNOWN_FILTER_FIELD FIELD_NOT_FILTERABLE UNSUPPORTED_FILTER_OPERATOR UNSUPPORTED_TEXT_COMPARISON INVALID_FILTER_VALUE INVALID_ENUM_VALUE AMBIGUOUS_ENUM_VALUE
message
required
string
suggestions
Array<string>
key
additional properties
any
Example
{
"issues": [
{
"code": "INVALID_FILTER_SHAPE"
}
]
}