For the complete documentation index, see llms.txt. This page is also available as Markdown.

Replace cancel

Beta. Catalog replace is a Beta feature and its API surface may change before GA. You must send the Batch-Beta: catalog-replace header with each replace call.

Use /catalogs/replace/cancel to close an open replace session without an apply. Batch discards the pending revision and all its staged items. The live catalog does not change.

Beta

Replace Cancel

post

Beta. Catalog replace is a Beta feature and can change. Send the Batch-Beta: catalog-replace header on each call. Cancels an open replace session. Batch discards the pending revision and all of its items. The live catalog does not change. A session that is already complete or cancelled returns 409 CATALOG_REPLACE_UNKNOWN.

Authorizations
AuthorizationstringRequired

API Key Authentication

Authentication is required in order to interact with Batch's APIs.

Batch implements authentication using API Keys, that we call the "REST API Key". You can find it on your dashboard.

Please make sure that you keep this key secret. You should never use it in client apps to call APIs from there as it would easily be extractable.

How to authenticate

In order to authenticate your requests, add your REST API Key in the Authorization header and prefix it by Bearer. Example: Authorization: Bearer bcd38d9rfb38ra28.

Header parameters
X-Batch-ProjectstringRequired

The unique project key, identifying a project on the Batch platform

Example: project_0664hxvwffvbpn278gxdyhsadddqgna6
Batch-BetastringRequired

Value of the Batch-Beta header. It is a comma-separated list of Beta contract flags. Thus one request can opt into more than one Beta contract at the same time (first-flag, second-flag). Flags are lowercase and case-sensitive, and the order does not matter. Batch rejects an unknown flag with a 400 on any endpoint. When a contract becomes generally available, Batch continues to accept its flag but the flag has no more effect. Thus you never need to remove it.

Example: catalog-replace
Body
replace_tokenstringRequired

Token that /catalogs/replace/start returns.

Example: eqRqTF7xFznYoG0MLs1sIqM1JhmhGLTZ7I5NtM5f
Responses
200

Empty success response

application/json
object · EmptyResponseOptional
post/catalogs/replace/cancel
POST /2.12/catalogs/replace/cancel HTTP/1.1
Host: api.batch.com
Authorization: Bearer YOUR_SECRET_TOKEN
X-Batch-Project: text
Batch-Beta: text
Content-Type: application/json
Accept: */*
Content-Length: 60

{
  "replace_token": "eqRqTF7xFznYoG0MLs1sIqM1JhmhGLTZ7I5NtM5f"
}
{}

Request structure

Route

The Catalog API has a POST endpoint that cancels a replace session:

/catalogs/replace/cancel

Headers and authentication

See Overview → Using Project APIs. This endpoint also needs the Batch-Beta: catalog-replace header.

Post data

The body of the request must contain a valid JSON payload. The payload gives the replace_token from /catalogs/replace/start.

Responses

Success

If the call is successful, you receive an HTTP 200 confirmation with an empty body. The session is closed. Batch discards the pending revision.

Failure

If the replace_token is unknown, or its session is complete or cancelled, you receive an HTTP 409 with the CATALOG_REPLACE_UNKNOWN error code.

For each other problem, you receive an error message that tells you what to do. Contact us at support@batch.com if you need more help.

Last updated