Skip to main content
PUT
Register a card set, or update it and its cards

Authorizations

X-Pincast-Key
string
header
required

Your app's key, sent on every call from your server only. It reads pck_, your app id, an underscore, then a secret of 20 or more letters, digits, underscores or hyphens. Never put it in a web page, an app bundle or a query string. Placecard stores only its sha256.

Your app can hold two live keys at once, so a key is replaced with no outage: the new key works at once, and the old one keeps working until its expiry (seven days after the new key is made, unless you ask for less). A revoked key is refused from the next call.

X-Placecard-Key, the older name of this header, is taken too, at either address. Send one of the two; if both come and they differ, the call answers 400 key_conflict.

Headers

Idempotency-Key
string

Optional, on the three writes. A string your app makes for one request, a UUID for example, and sends again unchanged with each retry of that request. Placecard keeps the first 200 answer to it for 24 hours, for your app only. A retry with the same key and the same request (method, path and body; the order of keys in the body does not matter) answers that answer again, marked Idempotent-Replayed: true, and runs nothing. The same key with a different request answers 422. A refused call keeps nothing, so its retry runs again. 1 to 255 visible ASCII characters, with no spaces.

Pattern: ^[\x21-\x7E]{1,255}$

Path Parameters

set
string
required

Your set's id, chosen by your app. Lowercase letters, digits, underscores and hyphens, starting with a letter or digit, 64 characters at most.

Pattern: ^[a-z0-9][a-z0-9_-]{0,63}$

Body

application/json
name
string
required

Trimmed before the check.

Required string length: 1 - 120
meta
object

Anything about the set your app wants kept, under 8000 characters as JSON. Two keys matter to every app: listed (false keeps the set off the map, the front page and card pages for people who do not hold its cards) and checkout (refused with field_invalid unless it is one of Pincast's own checkout paths for your app; selling through Pincast's checkout comes later).

cards
object[]
Maximum array length: 5000

Response

The set is registered. The counts say what this call changed; active counts the set's active cards by type after it.

app
string
required

Your app's id.

set
string
required

Lowercase letters, digits, underscores and hyphens, starting with a letter or digit, 64 characters at most.

Pattern: ^[a-z0-9][a-z0-9_-]{0,63}$
name
string
required
setCreated
boolean
required

True when this call created the set.

cards
object
required
active
object
required

A count for each card type.