A Custom Table is a saved column layout for the Contacts list on Manage Contacts: one row per Contact, with the columns an Organisation chooses (basic Contact fields, Bio Form questions, survey answers, progress trackers and relationships). A table belongs to its creator (owner: User, only they see it) or is shared with colleagues (owner: Charity, Organisation editors only). Its creator, or an Organisation editor for a shared table, can change it. A table you can't see returns 404; one you can see but not change returns 403.
Workflow: call GET /custom_tables/available_columns for the Organisation, pick columns from it, send them unchanged (in order) in columns on POST /custom_tables, then read values with GET /custom_tables/{id}/rows.
columns and can_edit" },
+ { code: "401", cls: "response-4xx", desc: "Not authenticated" }
+ ], "Your own tables and the Organisation tables shared with you, in your Organisations.")}
+ ${endpointCard("GET", "/custom_tables/available_columns", "List the columns a Custom Table can have", true, [
+ { name: "charity_id", type: "integer", required: true, desc: "Organisation ID" }
+ ], [
+ { code: "200", cls: "response-2xx", desc: "data: groups, each with a group name and its columns (class_name, field_name, field_id, display_name)" },
+ { code: "401", cls: "response-4xx", desc: "Not authenticated" },
+ { code: "404", cls: "response-4xx", desc: "Not one of your Organisations" }
+ ], "The columns the Create a table form offers, grouped the same way. Fields hidden from you by Field Visibility are left out.")}
+ ${endpointCard("GET", "/custom_tables/{id}", "Get a Custom Table", true, [
+ { name: "id", in: "path", type: "integer", required: true, desc: "Custom Table ID" }
+ ], [
+ { code: "200", cls: "response-2xx", desc: "The table: name, owner, visibility, individual_list, can_edit and columns" },
+ { code: "401", cls: "response-4xx", desc: "Not authenticated" },
+ { code: "404", cls: "response-4xx", desc: "Not found, or not visible to you" }
+ ])}
+ ${endpointCard("GET", "/custom_tables/{id}/rows", "Read a page of a Custom Table", true, [
+ { name: "id", in: "path", type: "integer", required: true, desc: "Custom Table ID" },
+ { name: "project_ids", type: "string", required: false, desc: "Comma-separated Project IDs: only Contacts in any of them" },
+ { name: "album_ids", type: "string", required: false, desc: "Comma-separated Album IDs you can see: only Contacts in their Projects" },
+ { name: "page", type: "integer", required: false, desc: "Page number (default 1)" },
+ { name: "per_page", type: "integer", required: false, desc: "Contacts per page (default 10, max 200)" }
+ ], [
+ { code: "200", cls: "response-2xx", desc: "headers (one per column) and data: a row per Contact with contact_id, contact_name and values in heading order, in the usual pagination envelope" },
+ { code: "401", cls: "response-4xx", desc: "Not authenticated" },
+ { code: "404", cls: "response-4xx", desc: "Table or Album not found, or not visible to you" }
+ ], "The values Manage Contacts shows for the table, for the Contacts you can see, ordered by Contact ID. Bio Form extended table fields aren't included.")}
+ ${endpointCard("POST", "/custom_tables", "Create a Custom Table", true, [
+ { name: "custom_table[charity_id]", in: "body", type: "integer", required: true, desc: "Organisation ID" },
+ { name: "custom_table[name]", in: "body", type: "string", required: true, desc: "The table's title" },
+ { name: "custom_table[columns]", in: "body", type: "array", required: false, desc: "Columns from available_columns, in order; display_name is the heading" },
+ { name: "custom_table[owner]", in: "body", type: "string", required: false, desc: "User (default, only you) or Charity (shared; editors only)" },
+ { name: "custom_table[visibility]", in: "body", type: "string", required: false, desc: "For a shared table: charity_colleagues (everyone) or individual_list" },
+ { name: "custom_table[individual_list]", in: "body", type: "array", required: false, desc: "User IDs of the colleagues who see it, for individual_list" }
+ ], [
+ { code: "201", cls: "response-2xx", desc: "The Custom Table" },
+ { code: "401", cls: "response-4xx", desc: "Not authenticated" },
+ { code: "404", cls: "response-4xx", desc: "Not one of your Organisations" },
+ { code: "422", cls: "response-4xx", desc: "errors: e.g. a column the Organisation doesn't offer, or one hidden from you" }
+ ], "Creates the table as Manage Contacts › Custom tables › Create a table does. It shows on Manage Contacts straight away.")}
+ ${endpointCard("PATCH", "/custom_tables/{id}", "Change a Custom Table", true, [
+ { name: "id", in: "path", type: "integer", required: true, desc: "Custom Table ID" },
+ { name: "custom_table", in: "body", type: "object", required: true, desc: "Any of name, columns, owner, visibility, individual_list" }
+ ], [
+ { code: "200", cls: "response-2xx", desc: "The Custom Table" },
+ { code: "401", cls: "response-4xx", desc: "Not authenticated" },
+ { code: "403", cls: "response-4xx", desc: "You can see the table but may not change it" },
+ { code: "404", cls: "response-4xx", desc: "Not found, or not visible to you" },
+ { code: "422", cls: "response-4xx", desc: "errors" }
+ ], "Only what you send changes. columns replaces all the columns; a column the table already has is kept even if it could no longer be added.")}
+ ${endpointCard("DELETE", "/custom_tables/{id}", "Delete a Custom Table", true, [
+ { name: "id", in: "path", type: "integer", required: true, desc: "Custom Table ID" }
+ ], [
+ { code: "204", cls: "response-2xx", desc: "Deleted" },
+ { code: "401", cls: "response-4xx", desc: "Not authenticated" },
+ { code: "403", cls: "response-4xx", desc: "You can see the table but may not delete it" },
+ { code: "404", cls: "response-4xx", desc: "Not found, or not visible to you" }
+ ], "Deletes the table only; Contacts and their data are untouched.")}
+