This page manages the cards your organization issues: taking a batch of
manufactured cards into inventory, setting what each card grants when it is
claimed, freezing one, and giving one up. All paths are under
https://api.davi.social/api/v1.
The calls take a staff member's user token or an
org-scoped token. Any staff role can read; changing
anything takes manager or owner.
| Method | Path | Scope |
|---|---|---|
GET | /organizations/{organization_slug}/cards | card:org:read |
POST | /organizations/{organization_slug}/cards | card:org:create |
GET | /organizations/{organization_slug}/cards/{card_uuid} | card:org:read |
PATCH | /organizations/{organization_slug}/cards/{card_uuid} | card:org:manage and card:org:freeze |
DELETE | /organizations/{organization_slug}/cards/{card_uuid} | card:org:manage |
Issuing a card and holding it are separate. These endpoints act on what your organization issued: which tier and design a card carries, and whether you have frozen it. Who holds a card, and the holder's own settings, are the holder's; see Read a Card.
Take cards into inventory
Every physical card is registered with Davi when it is manufactured, so your organization takes existing cards rather than creating them. Send the identifiers printed on or encoded in the cards:
curl -X POST "https://api.davi.social/api/v1/organizations/ORG_SLUG/cards" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"membership_tier_uuid": "TIER_UUID",
"cards": [
{ "identifier": "04A2B3C4D5E680" },
{ "identifier": "04A2B3C4D5E681" },
{ "identifier": "04A2B3C4D5E682", "membership_tier_uuid": "VIP_TIER_UUID" }
]
}'
membership_tier_uuid is the tier a card grants when somebody claims it. The
top-level value applies to every card, and a card's own value overrides it.
Leave both out for cards that grant no membership.
{
"assigned": [ { "uuid": "…", "identifier": "04A2B3C4D5E680", "…": "…" } ],
"failed": [ { "identifier": "04A2B3C4D5E682", "error": "…" } ]
}
- A batch succeeds card by card. An identifier Davi never registered, a
card in another organization's inventory, or a card somebody already holds
lands in
failedwith its reason, and the rest are assigned. Checkfailedon every response. - A repeat is harmless. Taking a card your organization already holds is a no-op, so re-send a whole batch after a timeout.
- A batch holds at most 20 cards, and each card counts separately against the expensive rate-limit bucket. A box of cards takes paced batches rather than one call.
Find a card
List the inventory with the standard pagination parameters. Two filters narrow it:
| Parameter | Matches |
|---|---|
identifier | Exactly this identifier. Use it to turn a scanned card into its uuid |
search | Identifiers containing this text, at least 2 characters |
curl "https://api.davi.social/api/v1/organizations/ORG_SLUG/cards?identifier=04A2B3C4D5E680" \
-H "Authorization: Bearer ACCESS_TOKEN"
Every other call addresses the card by its uuid.
Change what a card carries
PATCH sets the card's name, its card model, the tier it grants when claimed,
and your organization's freeze. Send only the fields you are changing, and an
empty string to clear one:
curl -X PATCH "https://api.davi.social/api/v1/organizations/ORG_SLUG/cards/CARD_UUID" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "membership_tier_uuid": "", "frozen": true }'
frozen is the issuer's freeze, and it wins. A card has two freeze flags,
yours and its holder's, and it is frozen while either is set. The holder cannot
clear yours. A frozen card is refused at check-in unless the session admits
frozen cards; see
Admission rules.
The tier applies at claim time. Changing it does not change a membership that a claim has already created.
Release a card
DELETE gives the card up. It returns to Davi's inventory and keeps its
identifier, and your organization stops being its issuer.
If somebody holds the card, they keep it, and the membership it gave them ends:
- By default the membership gets a week's notice. It keeps granting
everything until the week runs out. To undo a release made by mistake, call
off the revocation within the week with
DELETE /organizations/{organization_slug}/memberships/{user_uuid}/revocation; see Change a Membership. revoke_immediately=trueends it at once, for a card reported stolen.keep_membership=trueleaves the membership standing, for retiring a batch of cards without ending anyone's paid term.
curl -X DELETE \
"https://api.davi.social/api/v1/organizations/ORG_SLUG/cards/CARD_UUID?keep_membership=true" \
-H "Authorization: Bearer ACCESS_TOKEN"
Only the membership that came from this card is affected. A membership the holder has on another basis, such as one they joined themselves, is untouched.
Card models
A card model is a design your organization reuses across cards: its front
and back artwork, and optionally the profile template applied when a card is
claimed. Create models and upload their artwork in the dashboard. Through the
API you list them and assign one to a card by setting card_model_uuid.
| Method | Path | Scope |
|---|---|---|
GET | /organizations/{organization_slug}/card-models | card-model:read |
GET | /organizations/{organization_slug}/card-models/{card_model_uuid} | card-model:read |
POST | /organizations/{organization_slug}/card-models | card-model:create |
PATCH | /organizations/{organization_slug}/card-models/{card_model_uuid} | card-model:manage |
DELETE | /organizations/{organization_slug}/card-models/{card_model_uuid} | card-model:manage |
The list returns active models. Add include_inactive=true to include models
switched off with is_active: false. Deleting a model removes it from every
card that uses it, so deactivate one you may want back.
Next
- Read a Card: the public card document and the holder's view.
- Manage Tiers and Memberships: the tiers a card grants.
- Core Concepts: how issuing, claiming and releasing relate.