Add 1 to 50 locations at once, all or nothing
const url = 'https://api.creatorain.com/v1/locations/batch?dry_run=false';const options = { method: 'POST', headers: { 'Idempotency-Key': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"locations":[{"name":"Sexy Crab Duluth","address":"2416 Pleasant Hill Rd, Duluth, GA 30096","google_place_id":"example","plan":"paid","videos_per_month":4,"accepted_terms":"network-2026-10","opening_hours":{},"signature_dishes":[{"name":"example"}]}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url 'https://api.creatorain.com/v1/locations/batch?dry_run=false' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: example' \ --data '{ "locations": [ { "name": "Sexy Crab Duluth", "address": "2416 Pleasant Hill Rd, Duluth, GA 30096", "google_place_id": "example", "plan": "paid", "videos_per_month": 4, "accepted_terms": "network-2026-10", "opening_hours": {}, "signature_dishes": [ { "name": "example" } ] } ] }'Each location as in POST /locations. All or nothing: any refused item is
400 batch_invalid with every refused item in error.items by index, and nothing is written;
a write that fails part way writes nothing either. 201 when any store was created or brought
back, 200 when every one was a repeat (or a dry run).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”As Idempotency-Key, and required here (a location create). Without it the answer is
400 idempotency_key_required. A dry run needs one too: it writes no store row; the
Idempotency-Key is still stored.
Query Parameters
Section titled “Query Parameters”true validates and quotes: the same refusals as a live call, and writes no store row; the Idempotency-Key is still stored. Ids are null.
Request Bodyrequired
Section titled “Request Bodyrequired”object
object
Example
Sexy Crab DuluthAbsent means the account’s plan; another plan is 422 package_not_available.
Paid: 2 to 10. Free: exactly the free plan’s videos. Otherwise 400 videos_per_month_out_of_range.
Example
4The network terms version accepted
Example
network-2026-10The store’s week
object
Responses
Section titled “Responses”Every location was a repeat, or a dry run.
object
object
Null on a dry run.
Free: the free term. Paid: null, until stopped.
object
The half of month one: videos_per_month x price_per_video_cents / 2. Free: 0.
Never charged by this call.
The network state; null on a dry run.
object
Live stores of this account after the call (a dry run - as it would be).
Below_minimum while counting_locations is under min_locations.
Example
{ "object": "list", "locations": [ { "object": "location", "id": "loc_3f2a9c1e5b7d4a6f8e0c2b4d6f8a0c2e", "outcome": "create", "plan": "paid", "price_per_video_cents": 30000, "currency": "USD", "deposit": { "charged": false }, "state": "on_hold" } ], "account": { "min_locations": 3 }}Headers
Section titled “Headers”This request’s id. Equal to error.request_id; quote it to support.
True when this answer is the stored response to an earlier request with the same Idempotency-Key.
At least one location was created or brought back.
object
object
Null on a dry run.
Free: the free term. Paid: null, until stopped.
object
The half of month one: videos_per_month x price_per_video_cents / 2. Free: 0.
Never charged by this call.
The network state; null on a dry run.
object
Live stores of this account after the call (a dry run - as it would be).
Below_minimum while counting_locations is under min_locations.
Example
{ "object": "list", "locations": [ { "object": "location", "id": "loc_3f2a9c1e5b7d4a6f8e0c2b4d6f8a0c2e", "outcome": "create", "plan": "paid", "price_per_video_cents": 30000, "currency": "USD", "deposit": { "charged": false }, "state": "on_hold" } ], "account": { "min_locations": 3 }}Headers
Section titled “Headers”This request’s id. Equal to error.request_id; quote it to support.
True when this answer is the stored response to an earlier request with the same Idempotency-Key.
Parameter_invalid (with field) or invalid_json.
object
object
The request field at fault
Batch_invalid only. Every refused location, by its index in the request.
object
One of the error codes above.
Example
{ "error": { "type": "invalid_request_error", "code": "parameter_invalid", "doc_url": "https://www.creatorain.com/api/errors#scope_missing", "items": [ { "field": "locations.1.videos_per_month" } ] }}Headers
Section titled “Headers”This request’s id. Equal to error.request_id; quote it to support.
Invalid_key, test_key_on_live or live_key_on_sandbox.
object
object
The request field at fault
Batch_invalid only. Every refused location, by its index in the request.
object
One of the error codes above.
Example
{ "error": { "type": "invalid_request_error", "code": "parameter_invalid", "doc_url": "https://www.creatorain.com/api/errors#scope_missing", "items": [ { "field": "locations.1.videos_per_month" } ] }}Headers
Section titled “Headers”This request’s id. Equal to error.request_id; quote it to support.
Scope_missing or forbidden_ip.
object
object
The request field at fault
Batch_invalid only. Every refused location, by its index in the request.
object
One of the error codes above.
Example
{ "error": { "type": "invalid_request_error", "code": "parameter_invalid", "doc_url": "https://www.creatorain.com/api/errors#scope_missing", "items": [ { "field": "locations.1.videos_per_month" } ] }}Headers
Section titled “Headers”This request’s id. Equal to error.request_id; quote it to support.
Location_already_in_network (another team of this account holds the place, or the same place under another name), idempotency_conflict or idempotency_in_progress.
object
object
The request field at fault
Batch_invalid only. Every refused location, by its index in the request.
object
One of the error codes above.
Example
{ "error": { "type": "invalid_request_error", "code": "parameter_invalid", "doc_url": "https://www.creatorain.com/api/errors#scope_missing", "items": [ { "field": "locations.1.videos_per_month" } ] }}Headers
Section titled “Headers”This request’s id. Equal to error.request_id; quote it to support.
Package_not_available (a plan other than the account’s, or a free-plan account bringing back a store that already ran its free term).
object
object
The request field at fault
Batch_invalid only. Every refused location, by its index in the request.
object
One of the error codes above.
Example
{ "error": { "type": "invalid_request_error", "code": "parameter_invalid", "doc_url": "https://www.creatorain.com/api/errors#scope_missing", "items": [ { "field": "locations.1.videos_per_month" } ] }}Headers
Section titled “Headers”This request’s id. Equal to error.request_id; quote it to support.
Rate_limited (600 a minute per workspace, an onboarding create limit, or an address blocked after failed authentication), or slow_down (an onboarding session polled too fast).
object
object
The request field at fault
Batch_invalid only. Every refused location, by its index in the request.
object
One of the error codes above.
Example
{ "error": { "type": "invalid_request_error", "code": "parameter_invalid", "doc_url": "https://www.creatorain.com/api/errors#scope_missing", "items": [ { "field": "locations.1.videos_per_month" } ] }}Headers
Section titled “Headers”This request’s id. Equal to error.request_id; quote it to support.
Seconds to wait before retrying (at least 1).
Internal_error (500) or service_unavailable (503). The message never carries a cause.
object
object
The request field at fault
Batch_invalid only. Every refused location, by its index in the request.
object
One of the error codes above.
Example
{ "error": { "type": "invalid_request_error", "code": "parameter_invalid", "doc_url": "https://www.creatorain.com/api/errors#scope_missing", "items": [ { "field": "locations.1.videos_per_month" } ] }}Headers
Section titled “Headers”This request’s id. Equal to error.request_id; quote it to support.
Service_unavailable. A concurrent request wrote one of these locations; retry after Retry-After with the same key (it was not stored).
object
object
The request field at fault
Batch_invalid only. Every refused location, by its index in the request.
object
One of the error codes above.
Example
{ "error": { "type": "invalid_request_error", "code": "parameter_invalid", "doc_url": "https://www.creatorain.com/api/errors#scope_missing", "items": [ { "field": "locations.1.videos_per_month" } ] }}Headers
Section titled “Headers”This request’s id. Equal to error.request_id; quote it to support.
Seconds to wait before retrying (at least 1).