Skip to content

Add a business membership

POST/v1/businesses/{id}/memberships

Requires an API client bearer token.

Adds a person (a cardholder of the business's programme) to the business. A member may grant only the role and permissions it holds itself (permission_escalation_refused). Only an admin may hold an instructing permission (400 permission_requires_admin), and an admin needs KYC complete and an authority-to-act evidence reference (409 admin_requirements_not_met). Requires an Idempotency-Key. Emits business_membership.added. An API client names its acting person in X-Rigid-Acting-Person (400 acting_person_required without it); the person needs an active membership of the business with can_manage_members, else 403 acting_person_not_permitted. Every call with a well-formed body and an Idempotency-Key not already used with a different body, allowed or refused, writes one audit intent with the API client, the asserted person, the business and the decision. While the `business-cards` release flag is off for the caller's mode this route answers 404 to every authenticated, well-formed request not replaying an outcome stored while it was on, as if absent.

Parameters

Path parameters

NameRequiredDescription
idrequired

Header parameters

NameRequiredDescription
Idempotency-Keyrequired

Client-chosen. An identical retry with the same key returns the stored response; reusing the key with a different payload returns 409.

X-Rigid-Acting-Personoptional

Request body

cardholder_idstring (uuid)required
relationship"owner" | "director" | "employee" | "contractor" | "sole_trader"required
role"admin" | "member"required
permissionsobjectrequired
+ show properties
can_hold_cardbooleanrequired
can_reveal_own_panbooleanrequired
can_view_all_cardsbooleanrequired
can_reveal_pansbooleanrequired
can_grant_cardsbooleanrequired
can_manage_membersbooleanrequired
can_fundbooleanrequired
authority_evidence_refstring

Example

curl -X POST https://api.rigid.fi/v1/businesses/{id}/memberships \
  -H "Authorization: Bearer $RIGID_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "cardholder_id": "uuid",
  "relationship": "owner",
  "role": "admin",
  "permissions": {
    "can_hold_card": true,
    "can_reveal_own_pan": true,
    "can_view_all_cards": true,
    "can_reveal_pans": true,
    "can_grant_cards": true,
    "can_manage_members": true,
    "can_fund": true
  }
}'

Responses

201

Add a business membership — the result.

idstring (uuid)required
business_idstring (uuid)required
cardholder_idstring (uuid)required
relationship"owner" | "director" | "employee" | "contractor" | "sole_trader"required
role"admin" | "member"required
permissionsobjectrequired
+ show properties
can_hold_cardbooleanrequired
can_reveal_own_panbooleanrequired
can_view_all_cardsbooleanrequired
can_reveal_pansbooleanrequired
can_grant_cardsbooleanrequired
can_manage_membersbooleanrequired
can_fundbooleanrequired
state"active" | "suspended" | "removed"required
authority_evidence_refstring | nullrequired
created_atstring (date-time)required
suspended_atstring (date-time) | nullrequired
removed_atstring (date-time) | nullrequired
400

Validation error; or permission_requires_admin

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
401

Authentication required

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
403

The acting person is not permitted, or would grant what it does not hold (permission_escalation_refused)

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
404

Business or cardholder not found, or the business routes are not released

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
409

Idempotency-Key reused with a different payload; membership_exists; admin_requirements_not_met; business_closed

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
422

The person is a cardholder of another programme (cardholder_not_in_programme)

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring
500

Internal server error

typestringrequired
titlestringrequired
statusintegerrequired
detailstring
instancestring