For the complete documentation index, see llms.txt. This page is also available as Markdown.

Memberships

Manage organisation memberships under your partner account.

This endpoint set is partner-level only. Organisation API keys cannot access these endpoints.

Base URL: https://api.chargebackstop.com/v1/memberships/ Authentication: Bearer token via API key.

Required abilities:

  • memberships:read for GET endpoints

  • memberships:write for POST, PATCH, and DELETE endpoints

Access scope model:

  • Admin partner-group keys can access memberships across all organisations belonging to their partner.

  • Non-admin partner-group keys can access memberships only in organisations explicitly assigned to their group.

  • Organisation-level keys receive 401 Unauthorised on all endpoints in this API.


GET /v1/memberships - List memberships

Returns memberships accessible to the authenticated partner-group API key.

API level: Partner-level only Authentication: memberships:read

Query parameters

Parameter
Type
Description

organisation_id

string

Filter by exact organisation ID

limit

integer

Number of results per page

offset

integer

Number of results to skip

Results are ordered by created_at descending.

Example request

Example response


POST /v1/memberships - Create membership

Create a new membership for an accessible organisation.

API level: Partner-level only Authentication: memberships:write

Request body

Field
Type
Required
Validation
Description

organisation_id

string

Yes

Must be accessible by API key

Organisation that owns the membership

first_name

string

Yes

Min length 1

User first name

last_name

string

Yes

Min length 1

User last name

email

string

Yes

Valid email format

User email

role

string

Yes

ADMIN or STANDARD

Membership role

is_alert_action_required_email_enabled

boolean

No

Defaults to true

Alert action-required email setting

is_alert_resolved_email_enabled

boolean

No

Defaults to true

Alert resolved email setting

is_alert_dismissed_email_enabled

boolean

No

Defaults to true

Alert dismissed email setting

is_evidence_requested_email_enabled

boolean

No

Defaults to true

Evidence requested email setting

  • If the user is already a member of the organisation, the API returns 422 with MEMBERSHIP_ALREADY_EXISTS.

  • Notification setting values provided in the request are applied as sent.

Example request

Example response


GET /v1/memberships/{membership_id} - Get membership by ID

Retrieve one accessible membership by ID.

API level: Partner-level only Authentication: memberships:read

URL parameters

Parameter
Type
Description

membership_id

string

Membership ID

Example request

Example response


PATCH /v1/memberships/{membership_id} - Update membership

Update one accessible membership.

API level: Partner-level only Authentication: memberships:write

URL parameters

Parameter
Type
Description

membership_id

string

Membership ID to update

Request body

All fields are optional.

Field
Type
Required
Validation
Description

role

string

No

ADMIN or STANDARD

Updated membership role

is_alert_action_required_email_enabled

boolean

No

Optional

Updated alert action-required email setting

is_alert_resolved_email_enabled

boolean

No

Optional

Updated alert resolved email setting

is_alert_dismissed_email_enabled

boolean

No

Optional

Updated alert dismissed email setting

is_evidence_requested_email_enabled

boolean

No

Optional

Updated evidence requested email setting

  • Only fields included in the request are updated.

  • If no fields are provided, the API returns the existing membership unchanged.

Example request

Example response


DELETE /v1/memberships/{membership_id} - Delete membership

Delete one accessible membership.

API level: Partner-level only Authentication: memberships:write

URL parameters

Parameter
Type
Description

membership_id

string

Membership ID to delete

Example request

Example response

204 No Content


Common error responses

400 Invalid request

Returned when a membership cannot be created for the target user (for example, a staff user).

401 Unauthorised

Returned for invalid or expired API keys, and for organisation-level keys calling this partner-only API.

403 Forbidden (missing ability)

Returned when the API key is valid but missing required ability (memberships:read or memberships:write).

404 Not found

Returned when the membership is not found or outside the key's accessible scope.

422 Unprocessable Entity (membership already exists)
422 Unprocessable Entity (membership deletion forbidden)

Other business validation codes you may receive:

Code
Meaning

MEMBERSHIP_ALREADY_EXISTS

A membership for this user and organisation already exists

MEMBERSHIP_DELETION_FORBIDDEN

Membership cannot be deleted due to business rules

Schema validation errors are also returned as 422 with VALIDATION_* codes.

Last updated

Was this helpful?