Documentation

Manage Your Organization's Cards

Take manufactured cards into your organization's inventory, set the tier and design each one carries, freeze one, and release it.

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.

MethodPathScope
GET/organizations/{organization_slug}/cardscard:org:read
POST/organizations/{organization_slug}/cardscard: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 failed with its reason, and the rest are assigned. Check failed on 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:

ParameterMatches
identifierExactly this identifier. Use it to turn a scanned card into its uuid
searchIdentifiers 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=true ends it at once, for a card reported stolen.
  • keep_membership=true leaves 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.

MethodPathScope
GET/organizations/{organization_slug}/card-modelscard-model:read
GET/organizations/{organization_slug}/card-models/{card_model_uuid}card-model:read
POST/organizations/{organization_slug}/card-modelscard-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