{% extends "base.html" %} {% block title %}API Key: {{ api_key.name }} — {{ club.name }}{% endblock %} {% block content %}

{{ club.name }} — {{ api_key.name }}

Back to API keys {% if api_key.is_active %} Revoke key {% endif %}
{% if new_raw_key %}
Save this key now — it will not be shown again.
{{ new_raw_key }}
{% endif %}
Prefix{{ api_key.prefix }}…
Status{% if api_key.is_active %}Active{% else %}Revoked{% endif %}
Created{{ api_key.created_at|date:"N j, Y g:i a" }}
Last used{{ api_key.last_used_at|date:"N j, Y g:i a"|default:"Never" }}

Track activity for this key in club history — search for {{ api_key.prefix }}.

Permissions
Add club members{% if api_key.can_add_club_members %}Enabled{% else %}Disabled{% endif %}
Read club member list{% if api_key.can_read_club_member_list %}Enabled{% else %}Disabled{% endif %}
Update club members{% if api_key.can_update_club_members %}Enabled{% else %}Disabled{% endif %}
Add BAP points{% if api_key.can_add_bap_points %}Enabled{% else %}Disabled{% endif %}
Example endpoints
Send this key in the X-API-Key header (or Authorization: Api-Key <key>).
For write requests, also include Content-Type: application/json and send a JSON body.
{% if api_key.can_add_club_members %}
Add club member: POST https://{{ site_domain }}/api/v1/clubs/{{ club.slug }}/members/
Example body: {"name":"Mike","email":"mike@example.com"}
{% endif %} {% if api_key.can_read_club_member_list %}
Read club member list: GET https://{{ site_domain }}/api/v1/clubs/{{ club.slug }}/members/
Filter by name: ?name=mike — or use the same text filter as the admin member list: ?filter=expired, ?filter=mike, etc. (tokens: discord, current, expired, expiring, never paid, or any name/email text)
{% endif %} {% if api_key.can_update_club_members %}
Update club member: PATCH https://{{ site_domain }}/api/v1/clubs/{{ club.slug }}/members/{{ example_member_id|default:"123" }}/
Example body: {"email":"mike@example.com"}
{% endif %} {% if api_key.can_add_bap_points %}
Add BAP points: POST https://{{ site_domain }}/api/v1/clubs/{{ club.slug }}/members/{{ example_member_id|default:"123" }}/bap-awards/
Example body: {"points":5,"notes":"Bred angelfish","email":"mike@example.com"}
{% endif %}
Field mappings

Map incoming field names to club member fields. Unmapped fields are passed through unchanged if they match an allowed field name.

Members store a single name field. If first_name and/or last_name are sent (or mapped) instead, they will be combined into name.

Field mapping applies to club member create and update payloads. BAP point requests always use the fixed points, date, and notes fields directly.

{% if field_mappings %} {% for mapping in field_mappings %} {% endfor %}
External field (incoming)Internal field
{{ mapping.external_field }} {{ mapping.internal_field }}
{% csrf_token %}
{% else %}

No mappings yet.

{% endif %} {% if api_key.is_active %}
{% csrf_token %}
Allowed mapped club member fields: {% for field in available_fields %}{{ field }}{% if not forloop.last %}, {% endif %}{% endfor %}
{% endif %}
{% endblock %}