Skip to content

MerchJar Public API (v5)

Download OpenAPI specification:

The contract for the customer-facing MerchJar Public API. All paths in this document are relative to the server URL.

Getting started

Base URL

All requests use https://app.merchjar.com/api/v5.

Authentication

Send a provisioned MerchJar API key with every request:

curl https://app.merchjar.com/api/v5/profiles \
  -H 'Authorization: Bearer mj_live_…'

Create and manage API keys in Settings > API Keys. The full key is shown only once when you create it. Start with GET /profiles to discover the profile IDs available to the key.

Scopes

API keys are limited by scopes. Every operation lists its required scope in x-merchjar-required-scope; a key without that scope receives 403 Forbidden.

  • profiles:read: List accessible Amazon Advertising profiles.
  • segments:read: List and retrieve segments and their schedules.
  • segments:write: Create, update, and delete segments and schedules.
  • segments:preview: Preview segment results.
  • segments:validate: Validate a segment definition.
  • audit_logs:read: List audit logs and audit-log items.
  • history:read: Retrieve entity change history.
  • targets:read: Read Sponsored Products targets.
  • campaigns:write: Create and update Sponsored Products campaigns.
  • campaigns:archive: Archive Sponsored Products campaigns.
  • ad_groups:write: Create and update Sponsored Products ad groups.
  • ad_groups:archive: Archive Sponsored Products ad groups.
  • ads:write: Create and update Sponsored Products product ads.
  • ads:archive: Archive Sponsored Products product ads.
  • targets:write: Create and update Sponsored Products targets.
  • targets:archive: Archive Sponsored Products targets.
  • negative-targets:write: Create Sponsored Products negative product targets.
  • negative-targets:archive: Archive Sponsored Products negative targets.
  • bulk_actions:read: Retrieve submitted bulk actions.
  • custom_fields:read: Read custom-field catalogs, values, and CSV exports.
  • custom_fields:write: Manage custom-field definitions, values, and CSV imports.

Rate limits and retries

Use the response headers to make retry decisions; limits are enforced before the operation runs.

Request type Limit Identity On exhaustion
Standard API operations 1,200 requests per minute by default; an API key may have a configured override API key 429 with Retry-After; standard rate limit headers appear on successful and rate limited responses
POST /segments/preview In addition to the standard limit: a 3-request burst that refills one request every 2 seconds by default Account, shared across its API keys 429 with Retry-After; the rate limit headers report the preview-admission bucket
Campaign, ad-group, product-ad, and target creation No standard rate limit middleware currently Not applicable These endpoints do not emit the standard rate limit headers or standard 429/503 rate limit responses

Retry a 429 after the supplied Retry-After value. Retry a 503 only when that response includes Retry-After; otherwise investigate before retrying.

Compatibility

MerchJar makes additive, backward-compatible changes within v5. A breaking change uses a new API version and is documented in the reference before release. Deprecated operations remain documented with migration guidance and a removal date.

Errors

Handled API errors use a JSON envelope with error.code and error.message. Use the HTTP status to choose the next action: correct 400 requests, replace invalid or revoked 401 keys, request the required scope after 403, retry 429 after Retry-After, and retry only 503 responses that include Retry-After.

Segment frequencies and clock schedules

Segments return one of six frequencies. Five are writable; scheduled is server-managed.

Returned value Writable Contract
after_every_data_sync Yes Runs after each data sync.
daily Yes Runs daily.
weekly Yes Runs weekly.
monthly Yes Runs monthly.
manual Yes Never runs automatically and never has a schedule.
scheduled No Set by PUT /segments/{id}/schedule. Create rejects it with schedule_required; PATCH rejects it unless a schedule exists, when it is a no-op.

PATCH from scheduled to another frequency removes the schedule and skips future runs. DELETE /segments/{id}/schedule switches the segment to manual.

Profiles

List profiles available to your API key.

List profiles

Returns profiles owned by the API key's user. This operation does not require a profileid header; it is the operation used to discover profile IDs for later profile-scoped requests.

Authorizations:
API-Key

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Segments

Validate, preview, and manage segments.

Validate a segment trigger

Compiles a Segment DSL trigger without executing it. profile_id is optional unless the trigger references custom fields; when supplied, the API key must own that profile.

Authorizations:
API-Key
Request Body schema: application/json
required
trigger
required
string non-empty

Segment DSL expression to compile.

ad_type
required
string non-empty

Segment entity type. Input is case- and separator-insensitive; see the endpoint description for supported values.

profile_id
string (NumericString) ^[1-9][0-9]*$

Required when validating a trigger that references custom fields.

Responses

Request samples

Content type
application/json
{
  • "trigger": "string",
  • "ad_type": "string",
  • "profile_id": "9007199254740993"
}

Response samples

Content type
application/json
{
  • "valid": true,
  • "variables": { }
}

Preview segment matches

Evaluates a Segment DSL trigger for a profile without persisting a segment. Preview rows depend on ad_type; every returned field whose name ends in _id is serialized as a decimal string. In addition to the API-key per-minute limiter, preview uses an account-level burst-admission limiter.

Authorizations:
API-Key
Request Body schema: application/json
required
profile_id
required
string (NumericString) ^[1-9][0-9]*$

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

trigger
required
string non-empty

Segment DSL expression.

ad_type
required
string non-empty

One of campaigns, ad_groups, ads (or accepted alias product_ads), keywords, targets, keywords_and_targets, search_terms, placements, or a negative type. Input is case- and separator-insensitive. Negative types are preview-only.

action
required
string non-empty

One of set_state, set_budget, set_default_bid, set_bid, or create_negatives. Input is case- and separator-insensitive.

action_params
required
object

Action parameters. For set_state, value must be a number or numeric string (default 2). For set_budget, set_default_bid, and set_bid, direction defaults to set-to-$, value defaults to 0, and source defaults to value; source: variable makes value a DSL variable name. create_negatives accepts an empty object.

page
integer >= 1
Default: 1
per_page
integer [ 1 .. 100 ]
Default: 25

Responses

Request samples

Content type
application/json
{
  • "profile_id": "9007199254740993",
  • "trigger": "string",
  • "ad_type": "string",
  • "action": "string",
  • "action_params": { },
  • "page": 1,
  • "per_page": 25
}

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    },
  • "totals": {
    },
  • "meta": {
    }
}

List segments

Authorizations:
API-Key
header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Amazon Advertising profile ID owned by the API key.

Responses

Response samples

Content type
application/json
{
  • "data": [ ]
}

Create a segment

Creates a v2 segment for the body profile_id; it must belong to the API key. Run POST /segments/validate and POST /segments/preview first to check the trigger and matching entities. Negative segment types can be previewed but cannot be persisted.

Authorizations:
API-Key
Request Body schema: application/json
required
profile_id
required
string (NumericString) ^[1-9][0-9]*$

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

name
required
string [ 1 .. 255 ] characters
trigger
required
string non-empty
ad_type
required
string non-empty

A writable ad type: campaigns, ad_groups, ads (or accepted alias product_ads), keywords, targets, keywords_and_targets, search_terms, or placements. Input is case- and separator-insensitive.

action
required
string non-empty

set_state, set_budget, set_default_bid, set_bid, or create_negatives. Input is case- and separator-insensitive.

action_params
object
Default: {}

See preview action_params semantics. Unknown properties are ignored by the request parser.

frequency
string
Default: "daily"

Writable values are after_every_data_sync, daily, weekly, monthly, and manual. scheduled is rejected with 422 schedule_required unless the segment already has a schedule, when it is a no-op. A non-scheduled value on a scheduled segment removes the clock schedule and skips future runs. Input is case- and separator-insensitive; manually aliases manual. Weekly and monthly use today's date as their anchor whenever applied.

enabled
boolean
Default: true

Responses

Request samples

Content type
application/json
{
  • "profile_id": "9007199254740993",
  • "name": "string",
  • "trigger": "string",
  • "ad_type": "string",
  • "action": "string",
  • "action_params": { },
  • "frequency": "daily",
  • "enabled": true
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Create segment run

Runs the segment synchronously and returns its completed result. It works for disabled segments and does not enable the segment or change its schedule. A 202 response means the existing executor is still processing the run.

Authorizations:
API-Key
path Parameters
id
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740997

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Responses

Response samples

Content type
application/json
{
  • "uuid": "11111111-1111-4111-8111-111111111111",
  • "result": {
    }
}

Retrieve segment

Authorizations:
API-Key
path Parameters
id
required
string^[+-]?[0-9]+$

Segment ID. The implementation parses a signed base-10 bigint; successful segment IDs are positive decimal strings.

header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Amazon Advertising profile ID owned by the API key.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update a segment

Updates only supplied fields. PATCH away from scheduled atomically removes its clock schedule and supersedes future open runs. Negative segment types cannot be persisted.

Authorizations:
API-Key
path Parameters
id
required
string^[+-]?[0-9]+$

Segment ID. The implementation parses a signed base-10 bigint; successful segment IDs are positive decimal strings.

header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Amazon Advertising profile ID owned by the API key.

Request Body schema: application/json
required
name
string [ 1 .. 255 ] characters
trigger
string non-empty
ad_type
string non-empty

Writable segment ad type; input is case- and separator-insensitive.

action
string non-empty

set_state, set_budget, set_default_bid, set_bid, or create_negatives; input is case- and separator-insensitive.

action_params
object

See preview action_params semantics.

frequency
string

Writable values are after_every_data_sync, daily, weekly, monthly, and manual. scheduled is rejected with 422 schedule_required unless the segment already has a schedule, when it is a no-op. A non-scheduled value on a scheduled segment removes the clock schedule and skips future runs.

enabled
boolean
paused
boolean

Sets or clears the segment pause timestamp. true skips future open scheduled runs.

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "trigger": "string",
  • "ad_type": "string",
  • "action": "string",
  • "action_params": { },
  • "frequency": "string",
  • "enabled": true,
  • "paused": true
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete a segment

Disables the segment, marks it deleted, clears its next schedule cursor, and skips future open scheduled runs.

Authorizations:
API-Key
path Parameters
id
required
string^[+-]?[0-9]+$

Segment ID. The implementation parses a signed base-10 bigint; successful segment IDs are positive decimal strings.

header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Amazon Advertising profile ID owned by the API key.

Responses

Response samples

Content type
application/json
{
  • "success": true
}

List schedule timezones

Returns the timezone choices for a segment owned by the API-key profile.

Authorizations:
API-Key
path Parameters
id
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740997

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Retrieve segment schedule

Returns data: null when the owned segment has no stored clock schedule.

Authorizations:
API-Key
path Parameters
id
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740997

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Responses

Response samples

Content type
application/json
{
  • "data": null
}

Set segment schedule

Saves a clock schedule, sets the segment frequency to scheduled, and clears frequency parameters. The segment cannot be negative; preview_count is preview-only and rejected here.

Authorizations:
API-Key
path Parameters
id
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740997

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Request Body schema: application/json
required
One of
kind
required
any
Value: "cron"
timezone
required
string
cron_expression
required
string

Responses

Request samples

Content type
application/json
{
  • "kind": "cron",
  • "timezone": "America/Los_Angeles",
  • "cron_expression": "0 9 * * 1-5"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete segment schedule

Removes the schedule and switches the segment to manual.

Authorizations:
API-Key
path Parameters
id
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740997

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Responses

Response samples

Content type
application/json
{
  • "success": true
}

Preview segment schedule

Validates a proposed schedule without saving it for owned non-negative V2 segments.

Authorizations:
API-Key
path Parameters
id
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740997

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Request Body schema: application/json
required
One of
kind
required
any
Value: "cron"
timezone
required
string [ 1 .. 64 ] characters
cron_expression
required
string [ 1 .. 128 ] characters
run_once_at
null
preview_count
integer [ 1 .. 10 ]
Default: 5

Responses

Request samples

Content type
application/json
{
  • "kind": "once",
  • "timezone": "America/Los_Angeles",
  • "run_once_at": "2026-09-01T16:00:00.000Z",
  • "preview_count": 3
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Audit logs

Review audit logs and entity changes.

List audit logs

Lists profile-scoped records of MerchJar changes. The default date window is the 30 calendar days ending today, calculated when the request is handled.

Authorizations:
API-Key
query Parameters
page
integer >= 1
Default: 1

One-based page number. Missing, non-positive, or non-numeric values fall back to 1.

per_page
integer [ 1 .. 100 ]
Default: 25

Results per page. Missing, non-positive, or non-numeric values fall back to 25; values above 100 are capped at 100.

from
string
Example: from=2026-03-01

Inclusive UTC start date. Send an ISO calendar date such as 2026-03-01; the route uses the start of that day. Defaults to 30 days ago.

to
string
Example: to=2026-03-31

Inclusive UTC end date. Send an ISO calendar date such as 2026-03-31; the route uses the end of that day. Defaults to today.

target_type
string
Enum: "campaigns" "ad_groups" "product_ads" "keywords" "targets" "campaign_negative_keywords" "negative_keywords" "negative_targets" "portfolios" "promotions" "recipes" "search_terms" "ads" "placements"

Filter by affected entity type.

source_type
string
Enum: "smart_bids" "promotion" "recipe" "bulk_action" "public_api"

Filter by the type of source that initiated the audit log.

source_id
string^[1-9][0-9]*$
Example: source_id=9007199254740995

Filter by source ID. Send the ID as a decimal string so clients do not lose bigint precision.

count
string^(?:gt|gte|lt|lte|eq|neq):-?[0-9]+$|^between:...
Example: count=gt:10

Filter on meta.count: gt:N, gte:N, lt:N, lte:N, eq:N, neq:N, or between:N,M.

sort
string
Default: "-created_at"

Sort by created_at (the default) or effected_entities; prefix either with - for descending order. Unknown sort fields currently fall back to created_at.

header Parameters
profileid
required
string <= 19 characters ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

List audit log changes

Returns items only after verifying that the parent audit log belongs to the requested profile. The item data is retrieved from MerchJar's internal Laravel service and bigint identifiers are re-serialized as strings.

Authorizations:
API-Key
path Parameters
id
required
string^[1-9][0-9]*$
Example: 789

Audit-log ID as a decimal string.

query Parameters
page
integer >= 1
Default: 1

One-based page number. Missing, non-positive, or non-numeric values fall back to 1.

per_page
integer [ 1 .. 100 ]
Default: 25

Results per page. Missing, non-positive, or non-numeric values fall back to 25; values above 100 are capped at 100.

target_type
string
Enum: "campaigns" "ad_groups" "product_ads" "keywords" "targets" "campaign_negative_keywords" "negative_keywords" "negative_targets" "portfolios" "promotions" "recipes" "search_terms" "ads" "placements"

Filter item rows by target entity type.

target_id
string^[1-9][0-9]*$
Example: target_id=9007199254740997

Filter item rows by affected entity ID. Send the ID as a decimal string so clients do not lose bigint precision.

header Parameters
profileid
required
string <= 19 characters ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    },
  • "audit_log": {
    }
}

History

View bid and budget changes.

List entity changes

Returns the profile-scoped legacy bid-history stream, newest first with hash as the tie-breaker. MerchJar selects the change type from entity_type: campaign budgets, ad-group default bids, and keyword or target bids.

Authorizations:
API-Key
path Parameters
entity_type
required
string
Enum: "campaigns" "ad_groups" "keywords" "targets"
entity_id
required
string^[1-9][0-9]*$
Example: 9007199254740997

Positive PostgreSQL-signed-bigint entity ID encoded as a decimal string (maximum 9223372036854775807).

query Parameters
page
integer >= 1
Default: 1

One-based page number. Missing, non-positive, or non-numeric values fall back to 1; values above 21474836 are capped.

per_page
integer [ 1 .. 100 ]
Default: 25

Results per page. Missing, non-positive, or non-numeric values fall back to 25; values above 100 are capped at 100.

header Parameters
profileid
required
string <= 19 characters ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Custom fields

Manage field definitions, values, and CSV jobs.

Import custom field CSV

Queues a CSV import for the selected entity type. The request body must be UTF-8 text/csv and no larger than 25 MiB. Set dry_run=true to validate without applying mutations.

Authorizations:
API-Key
path Parameters
entityType
required
string (CustomFieldEntityType)
Enum: "campaign" "ad_group" "target" "ad"
Example: campaign
query Parameters
dry_run
boolean
header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Request Body schema: text/csv
required
string

Responses

Request samples

Content type
text/csv
entity_id,field,value
9007199254740995,Priority,high

Response samples

Content type
application/json
{
  • "job": {
    }
}

Export custom field CSV

Queues a CSV export for the selected entity type.

Authorizations:
API-Key
path Parameters
entityType
required
string (CustomFieldEntityType)
Enum: "campaign" "ad_group" "target" "ad"
Example: campaign
header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Responses

Response samples

Content type
application/json
{
  • "job": {
    }
}

Retrieve CSV job

Authorizations:
API-Key
path Parameters
jobId
required
string
Example: job_01HXYZ
header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Responses

Response samples

Content type
application/json
{
  • "job": {
    }
}

Cancel CSV job

Authorizations:
API-Key
path Parameters
jobId
required
string
Example: job_01HXYZ
header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Responses

Response samples

Content type
application/json
{
  • "job": {
    }
}

Download CSV errors

Authorizations:
API-Key
path Parameters
jobId
required
string
Example: job_01HXYZ
header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Responses

Response samples

Content type
text/csv
row,error
2,invalid value

Download CSV export

Authorizations:
API-Key
path Parameters
jobId
required
string
Example: job_01HXYZ
header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Responses

Response samples

Content type
text/csv
entity_id,field,value
9007199254740995,Priority,high

Retrieve field catalog

Authorizations:
API-Key
path Parameters
entityType
required
string (CustomFieldEntityType)
Enum: "campaign" "ad_group" "target" "ad"
Example: campaign
header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Responses

Response samples

Content type
application/json
{
  • "version": "1",
  • "definitions": [ ],
  • "definition_count": 0,
  • "value_count": 0
}

Snapshot field values

Authorizations:
API-Key
path Parameters
entityType
required
string (CustomFieldEntityType)
Enum: "campaign" "ad_group" "target" "ad"
Example: campaign
header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Request Body schema: application/json
required
entity_ids
required
Array of strings (NumericString) non-empty [ items^[1-9][0-9]*$ ]

Responses

Request samples

Content type
application/json
{
  • "entity_ids": [
    ]
}

Response samples

Content type
application/json
{
  • "values": [ ]
}

Create field definition

Authorizations:
API-Key
header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Request Body schema: application/json
required
entity_type
required
string (CustomFieldEntityType)
Enum: "campaign" "ad_group" "target" "ad"
name
required
string
description
string or null
data_type
required
integer
Enum: 1 2 3

Responses

Request samples

Content type
application/json
{
  • "entity_type": "campaign",
  • "name": "Priority",
  • "data_type": 1
}

Response samples

Content type
application/json
{
  • "definition": {
    }
}

Update field definition

Authorizations:
API-Key
path Parameters
definitionId
required
string (NumericString) ^[1-9][0-9]*$
Example: 1

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Request Body schema: application/json
required
entity_type
required
string (CustomFieldEntityType)
Enum: "campaign" "ad_group" "target" "ad"
expected_version
required
string (NumericString) ^[1-9][0-9]*$

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

name
required
string
description
string or null

Responses

Request samples

Content type
application/json
{
  • "entity_type": "campaign",
  • "expected_version": "1",
  • "name": "Priority"
}

Response samples

Content type
application/json
{
  • "definition": {
    }
}

Delete field definition

Authorizations:
API-Key
path Parameters
definitionId
required
string (NumericString) ^[1-9][0-9]*$
Example: 1

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Request Body schema: application/json
required
entity_type
required
string (CustomFieldEntityType)
Enum: "campaign" "ad_group" "target" "ad"
expected_version
required
string (NumericString) ^[1-9][0-9]*$

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

disable_dependants
boolean

Responses

Request samples

Content type
application/json
{
  • "entity_type": "campaign",
  • "expected_version": "1"
}

Response samples

Content type
application/json
{
  • "values": [ ]
}

List field values

Authorizations:
API-Key
path Parameters
entityType
required
string (CustomFieldEntityType)
Enum: "campaign" "ad_group" "target" "ad"
Example: campaign
query Parameters
entity_id
string (NumericString) ^[1-9][0-9]*$
Example: entity_id=9007199254740995

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

entity_ids
string
Example: entity_ids=9007199254740995,9007199254740996
header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Responses

Response samples

Content type
application/json
{
  • "values": [ ]
}

List definition values

Authorizations:
API-Key
path Parameters
entityType
required
string (CustomFieldEntityType)
Enum: "campaign" "ad_group" "target" "ad"
Example: campaign
definitionId
required
string (NumericString) ^[1-9][0-9]*$
Example: 1

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

query Parameters
limit
integer [ 1 .. 200 ]
Example: limit=100
after_entity_id
string (NumericString) ^[1-9][0-9]*$
Example: after_entity_id=9007199254740995

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Responses

Response samples

Content type
application/json
{
  • "values": [ ]
}

Update field values

Authorizations:
API-Key
path Parameters
entityType
required
string (CustomFieldEntityType)
Enum: "campaign" "ad_group" "target" "ad"
Example: campaign
header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Request Body schema: application/json
required
required
Array of objects
source_reference
string or null <= 100 characters

Responses

Request samples

Content type
application/json
{
  • "mutations": [
    ]
}

Response samples

Content type
application/json
{
  • "values": [ ]
}

List field value history

Returns history newest-first by (created_at, id). To fetch the next page, send before_id equal to the final history id from the previous response; the cursor is excluded, so the next response contains older history. Preserve definition_id when it was used on the first request. For example, first request: /custom-fields/values/campaign/9007199254740995/history?definition_id=9007199254740997&limit=2; if its final history id is 9007199254741999, second request: /custom-fields/values/campaign/9007199254740995/history?definition_id=9007199254740997&limit=2&before_id=9007199254741999. A supplied cursor that does not match history in this request scope returns empty history.

Authorizations:
API-Key
path Parameters
entityType
required
string (CustomFieldEntityType)
Enum: "campaign" "ad_group" "target" "ad"
Example: campaign
entityId
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740995

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

query Parameters
definition_id
string (NumericString) ^[1-9][0-9]*$
Example: definition_id=1

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

before_id
string (NumericString) ^[1-9][0-9]*$
Example: before_id=9007199254741999

The final history ID from the preceding page, sent as a decimal string.

limit
integer [ 1 .. 200 ]
Example: limit=100
header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Responses

Response samples

Content type
application/json
{
  • "values": [ ]
}

Roll back field change

Authorizations:
API-Key
path Parameters
historyId
required
string (NumericString) ^[1-9][0-9]*$
Example: 1

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Request Body schema: application/json
required
entity_type
required
string (CustomFieldEntityType)
Enum: "campaign" "ad_group" "target" "ad"
expected_version
required
string or null^[1-9][0-9]*$

Responses

Request samples

Content type
application/json
{
  • "entity_type": "campaign",
  • "expected_version": "1"
}

Response samples

Content type
application/json
{
  • "values": [ ]
}

Targets

List and retrieve Sponsored Products targets.

List targets

Lists Sponsored Products targets for the API-key-authorized profileid header. Results come from MerchJar's own target records and carry no performance metrics. Every filter is optional; an unfiltered page returns positive and negative targets of every target type. A successful public target create, update, or archive has already written its local projection before it returned, but a change made in Amazon or another tool appears only after the next MerchJar ingestion.

Authorizations:
API-Key
query Parameters
page
integer >= 1
Default: 1
Example: page=1

One-based page number.

per_page
integer [ 1 .. 100 ]
Default: 25
Example: per_page=25

Results per page, from 1 through 100.

campaign_id
string (NumericString) ^[1-9][0-9]*$
Example: campaign_id=9007199254740994

Return only targets in this campaign. Send the ID as a decimal string.

ad_group_id
string (NumericString) ^[1-9][0-9]*$
Example: ad_group_id=9007199254740995

Return only targets in this ad group. Send the ID as a decimal string.

state
string
Enum: "ENABLED" "PAUSED" "ARCHIVED"
Example: state=ENABLED

Return only targets in this serving state.

target_type
string non-empty
Example: target_type=KEYWORD

Return only targets of this target type, such as KEYWORD, PRODUCT, PRODUCT_CATEGORY, or THEME.

negative
boolean
Example: negative=true

Return only negative targets when true, or only positive targets when false. Omitting this parameter returns both positive and negative targets.

sort
string
Default: "target_id"
Enum: "target_id" "-target_id" "last_updated_date_time" "-last_updated_date_time"
Example: sort=-last_updated_date_time

Sort field. Prefix with - for descending order.

header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Retrieve a target

Retrieves one Sponsored Products target owned by the API-key-authorized profileid header. The response carries no performance metrics. A target belonging to another profile is reported as 404 not_found, so a cross-profile ID is indistinguishable from an absent ID.

Authorizations:
API-Key
path Parameters
id
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740997

Target ID. Send it as a positive decimal string, never as a JavaScript number.

header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Campaign creation

Create Sponsored Products campaigns.

Create Sponsored Products campaigns

Creates between 1 and 1,000 Sponsored Products campaigns for the API-key-authorized profileid header. The request schema is strict: profile_id and every other undeclared field are rejected before MerchJar calls Amazon. The 200 response is Amazon's raw batch envelope, without a MerchJar wrapper. A success or partialSuccess result queues local projection; browse data is eventually consistent and the response does not report projection completion. An error-only Amazon envelope is also passed through, but does not queue a receipt. MerchJar provides no idempotency guarantee and does not automatically retry creates; if the outcome is unknown, verify Amazon or the normal read state before retrying. This router does not currently install the API-key rate limit middleware, so it does not emit the standard rate limit headers or 429/503 rate limit responses.

Authorizations:
API-Key
header Parameters
profileid
required
string^(?:[1-9][0-9]{0,17}|[1-8][0-9]{18}|9[0-1][0-...
Example: 9007199254740993

Positive PostgreSQL signed-bigint Amazon Advertising profile ID owned by the API key. Send it as a decimal string, never as a JavaScript number.

Request Body schema: application/json
required
required
Array of objects [ 1 .. 1000 ] items

Responses

Request samples

Content type
application/json
{
  • "campaigns": [
    ]
}

Response samples

Content type
application/json
{
  • "error": [
    ],
  • "success": [
    ],
  • "partialSuccess": [
    ]
}

Update Sponsored Products campaign settings

Updates supplied Sponsored Products name, daily budget, bidding strategy, and/or placement adjustments for the API-key-authorized profile. The body is strict and sparse: omitted settings are not cleared. MerchJar passes Amazon's raw update envelope through unchanged and never retries an uncertain write.

Authorizations:
API-Key
path Parameters
id
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive Amazon campaign ID as a decimal string; do not send a JavaScript number.

header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive PostgreSQL signed-bigint Amazon Advertising profile ID owned by the API key.

Idempotency-Key
required
string [ 1 .. 64 ] characters

Required 1-64 character opaque request identifier for durable, idempotent updates.

Request Body schema: application/json
required
Any of
name
required
string [ 1 .. 255 ] characters
Array of objects = 1 items
object

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "budgets": [
    ],
  • "optimizations": {
    }
}

Response samples

Content type
application/json
{ }

Ad group creation

Create Sponsored Products ad groups.

Create ad groups

Creates between 1 and 1,000 Sponsored Products ad groups for the API-key-authorized profileid header. The request schema is strict: profile_id and every other undeclared field are rejected before MerchJar calls Amazon. campaignId is forwarded directly to Amazon; MerchJar does not locally check that the campaign exists or is compatible. The 200 response is Amazon's raw batch envelope, without a MerchJar wrapper. A success or partialSuccess result queues local projection; browse data is eventually consistent and the response does not report projection completion. An error-only Amazon envelope is also passed through, but does not queue a receipt. MerchJar provides no idempotency guarantee and does not automatically retry creates; if the outcome is unknown, verify Amazon or the normal read state before retrying. This router does not currently install the API-key rate limit middleware, so it does not emit the standard rate limit headers or 429/503 rate limit responses.

Authorizations:
API-Key
header Parameters
profileid
required
string^(?:[1-9][0-9]{0,17}|[1-8][0-9]{18}|9[0-1][0-...
Example: 9007199254740993

Positive PostgreSQL signed-bigint Amazon Advertising profile ID owned by the API key. Send it as a decimal string, never as a JavaScript number.

Request Body schema: application/json
required
required
Array of objects [ 1 .. 1000 ] items

Responses

Request samples

Content type
application/json
{
  • "adGroups": [
    ]
}

Response samples

Content type
application/json
{
  • "error": [
    ],
  • "success": [
    ],
  • "partialSuccess": [
    ]
}

Update an ad group

Updates only defaultBid and/or state for one Sponsored Products ad group. An Idempotency-Key is required; unknown outcomes must be checked before retrying.

Authorizations:
API-Key
path Parameters
id
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740995

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

Idempotency-Key
required
string [ 1 .. 64 ] characters
Request Body schema: application/json
required
Any of
required
object
state
any
Enum: "ENABLED" "PAUSED"

Responses

Request samples

Content type
application/json
{
  • "bid": {
    },
  • "state": "ENABLED"
}

Response samples

Content type
application/json
{
  • "error": {
    }
}

Delete an ad group

Archives one Sponsored Products ad group and confirms Amazon reports ARCHIVED before local projection. An Idempotency-Key is required.

Authorizations:
API-Key
path Parameters
id
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740995

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

Idempotency-Key
required
string [ 1 .. 64 ] characters

Responses

Response samples

Content type
application/json
{
  • "error": {
    }
}

Product ad creation

Create Sponsored Products ads.

Create product ads

Creates between 1 and 1,000 Sponsored Products product ads for the API-key-authorized profileid header. This is deliberately not generic unified-v1 ad creation: each item supports only PRODUCT_AD with exactly one productCreative / advertisedProduct creative. The request schema is strict: profile_id, marketplace/global-store identity, headline, and every other undeclared field are rejected before MerchJar calls Amazon. The 200 response is Amazon's raw batch envelope, without a MerchJar wrapper. A success or partialSuccess result queues local projection; browse data is eventually consistent and the response does not report projection completion. An error-only Amazon envelope is also passed through, but does not queue a receipt. MerchJar provides no idempotency guarantee and does not automatically retry creates; if the outcome is unknown, verify Amazon or the normal read state before retrying. This router does not currently install the API-key rate limit middleware, so it does not emit the standard rate limit headers or 429/503 rate limit responses.

Authorizations:
API-Key
header Parameters
profileid
required
string^(?:[1-9][0-9]{0,17}|[1-8][0-9]{18}|9[0-1][0-...
Example: 9007199254740993

Positive PostgreSQL signed-bigint Amazon Advertising profile ID owned by the API key. Send it as a decimal string, never as a JavaScript number.

Request Body schema: application/json
required
required
Array of objects [ 1 .. 1000 ] items

Responses

Request samples

Content type
application/json
{
  • "ads": [
    ]
}

Response samples

Content type
application/json
{
  • "error": [
    ],
  • "success": [
    ],
  • "partialSuccess": [
    ]
}

Update a product ad

Updates only state for one Sponsored Products product ad. An Idempotency-Key is required.

Authorizations:
API-Key
path Parameters
id
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740995

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

Idempotency-Key
required
string [ 1 .. 64 ] characters
Request Body schema: application/json
required
state
required
any
Enum: "ENABLED" "PAUSED"

Responses

Request samples

Content type
application/json
{
  • "state": "ENABLED"
}

Response samples

Content type
application/json
{
  • "error": {
    }
}

Delete a product ad

Archives one Sponsored Products product ad and verifies the terminal state; Amazon may omit an archived product ad from read-back. An Idempotency-Key is required.

Authorizations:
API-Key
path Parameters
id
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740995

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

Idempotency-Key
required
string [ 1 .. 64 ] characters

Responses

Response samples

Content type
application/json
{
  • "error": {
    }
}

Target creation

Create Sponsored Products targets.

Create negative targets

Creates between 1 and 1,000 negative Sponsored Products product targets for the API-key-authorized profileid header. Each target must have an ad-group parent, negative: true, targetType: PRODUCT, PRODUCT_EXACT matching, and an ASIN. The request schema is strict: unknown fields are rejected before MerchJar calls Amazon. A success or partialSuccess result queues local projection; an error-only envelope does not. MerchJar provides no idempotency guarantee and does not automatically retry creates; if the outcome is unknown, verify Amazon or the normal read state before retrying. This endpoint does not install the standard API-key rate limit middleware, so it does not emit the standard rate limit headers or standard 429 or 503 rate limit responses.

Authorizations:
API-Key
header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive Amazon Advertising profile ID owned by the API key. Send it as a decimal string, never as a JavaScript number.

Request Body schema: application/json
required
required
Array of objects [ 1 .. 1000 ] items

Responses

Request samples

Content type
application/json
{
  • "targets": [
    ]
}

Response samples

Content type
application/json
{
  • "error": [
    ],
  • "success": [
    ],
  • "partialSuccess": [
    ]
}

Create targets

Creates between 1 and 1,000 Sponsored Products targets for the API-key-authorized profileid header. The request schema is strict: unknown fields are rejected before MerchJar calls Amazon. The response is Amazon's raw batch envelope. A success or partialSuccess result queues local projection; an error-only envelope does not. MerchJar provides no idempotency guarantee and does not automatically retry creates; if the outcome is unknown, verify Amazon or the normal read state before retrying. This endpoint does not install the standard API-key rate limit middleware, so it does not emit the standard rate limit headers or standard 429 or 503 rate limit responses.

Authorizations:
API-Key
header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive Amazon Advertising profile ID owned by the API key. Send it as a decimal string, never as a JavaScript number.

Request Body schema: application/json
required
required
Array of objects or objects or objects or objects or objects or objects [ 1 .. 1000 ] items

One to 1,000 targets. Each target uses exactly one target type and matching target-details shape.

Responses

Request samples

Content type
application/json
{
  • "targets": [
    ]
}

Response samples

Content type
application/json
{
  • "success": [
    ]
}

Update a target

Updates only bid and/or state for one Sponsored Products target. An Idempotency-Key is required.

Authorizations:
API-Key
path Parameters
id
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740995

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

Idempotency-Key
required
string [ 1 .. 64 ] characters
Request Body schema: application/json
required
Any of
required
object
state
any
Enum: "ENABLED" "PAUSED"

Responses

Request samples

Content type
application/json
{
  • "bid": {
    },
  • "state": "ENABLED"
}

Response samples

Content type
application/json
{
  • "error": {
    }
}

Delete a target

Archives one Sponsored Products target and confirms Amazon reports ARCHIVED before local projection. An Idempotency-Key is required.

Authorizations:
API-Key
path Parameters
id
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740995

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

Idempotency-Key
required
string [ 1 .. 64 ] characters

Responses

Response samples

Content type
application/json
{
  • "error": {
    }
}

Bulk actions

Manage bulk actions.

Create bulk action

Submits a profile-scoped bulk action for asynchronous processing. Submit, then poll GET /bulk-actions/{request_id} until status is terminal, then page through items. Idempotency-Key is the durable request_id, scoped per profile. Reusing the same key returns the current record (202 while queued or running; 200 when terminal); request bodies are not fingerprinted, so a reused key with a different body returns the original record. The static required scope is campaigns:write only because the actual scope is derived from the request body.

Scope table (v1):

entity_type non-archive actions archived
campaigns campaigns:write campaigns:archive (NEW)
ad_groups ad_groups:write ad_groups:archive
keywords, targets targets:write targets:archive
product_ads ads:write ads:archive
negative_keywords, negative_targets, campaign_negative_keywords negative-targets:write negative-targets:archive (NEW)
GET /bulk-actions/{request_id} bulk_actions:read (NEW)

Unsupported operations: portfolio moves, dates, bid strategy, placements, creates, recipes, local-only actions, and search terms.

Authorizations:
API-Key
header Parameters
Idempotency-Key
required
string^[\x21-\x7e]{1,64}$
Example: abc-123

Durable request_id, scoped per profile. The body is not fingerprinted; reusing this key returns the current record.

Request Body schema: application/json
required
profile_id
required
string (NumericString) ^[1-9][0-9]*$

A positive base-10 integer encoded as a string. Use this for profile IDs and entity IDs so values larger than JavaScript's safe integer limit retain their precision.

entity_type
required
string
Enum: "campaigns" "ad_groups" "keywords" "targets" "product_ads" "negative_keywords" "negative_targets" "campaign_negative_keywords"
entity_ids
required
Array of strings (NumericString) [ 1 .. 50000 ] items unique [ items^[1-9][0-9]*$ ]
required
any

Responses

Request samples

Content type
application/json
{
  • "profile_id": "123456789012345",
  • "entity_type": "keywords",
  • "entity_ids": [
    ],
  • "action": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "pagination": {
    }
}

Retrieve bulk action

Retrieves a submitted bulk action without resuming it. While the status is queued or running, it returns 202 with no items and null counts. Once terminal, it returns 200 and a page of items.

Authorizations:
API-Key
path Parameters
request_id
required
string^[\x21-\x7e]{1,64}$
Example: abc-123

The Idempotency-Key used to submit the bulk action.

query Parameters
page
integer >= 1
Default: 1

One-based item page number. Defaults to 1.

per_page
integer [ 1 .. 1000 ]
Default: 1000

Items per page. Defaults to 1000; values above 1000 are capped at 1000.

header Parameters
profileid
required
string (NumericString) ^[1-9][0-9]*$
Example: 9007199254740993

Positive decimal Amazon Advertising profile ID owned by the API-key user.

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "pagination": {
    }
}