GravityBoard Developer Docs (Hooks & REST API)
GravityBoard provides hooks that developers can use to extend or modify functionality.
Actions and Filters #
GravityBoard provides hooks that developers can use to extend or modify functionality.
Assignee Actions
| Hook Name | Description | Parameters |
|---|---|---|
gk/gravityboard/assignees/added | Fires when a user is assigned to a card | $user_id (int), $entry_id (int), $feed (array), $form (array) |
gk/gravityboard/assignees/removed | Fires when a user is unassigned from a card | $user_id (int), $entry_id (int), $feed (array), $form (array) |
gk/gravityboard/assignees/updated | Fires after entry assignees are updated | $entry_id (int), $assignees (array), $feed (array), $form (array) |
Attachment Actions
| Hook Name | Description | Parameters |
|---|---|---|
gk/gravityboard/attachments/added | Fires when attachments are added to a card | $attachments (array), $entry (array), $feed (array) |
gk/gravityboard/attachments/removed | Fires when attachments are removed from a card | $attachment_ids (array), $entry (array), $feed (array) |
gk/gravityboard/attachments/updated | Fires when attachments have been updated | $attachments (array), $entry (array), $feed (array) |
Card Actions
| Hook Name | Description | Parameters |
|---|---|---|
gk/gravityboard/card/added | Fires when a new card is added to the board | $entry (array), $feed (array), $form (array) |
gk/gravityboard/card/edited | Fires when a card’s details are updated | $entry (array), $feed (array), $form (array) |
gk/gravityboard/card/changed-lane | Fires when a card is moved to a different lane | $entry (array), $old_lane_id (string), $new_lane_id (string), $feed (array), $form (array) |
gk/gravityboard/card/sorted | Fires when a card is reordered within the same lane | $entry (array), $lane_id (string), $old_position (int), $new_position (int), $feed (array), $form (array) |
gk/gravityboard/card/deleted | Fires when a card is removed from the board | $entry (array), $feed (array), $form (array) |
Checklist Actions
| Hook Name | Description | Parameters |
|---|---|---|
gk/gravityboard/checklists/updated | Fires when checklists have been updated | $checklists (ChecklistCollection), $entry (array), $feed (array) |
gk/gravityboard/checklists/item/added | Fires when a checklist item has been added | $entry (array), $new_item (ChecklistItem), $feed (array) |
gk/gravityboard/checklists/item/updated | Fires when a checklist item has been updated | $entry (array), $item (ChecklistItem), $collection (ChecklistCollection), $feed (array) |
gk/gravityboard/checklists/item/deleted | Fires when a checklist item has been deleted | $entry (array), $item (ChecklistItem), $checklists (ChecklistCollection), $feed (array) |
gk/gravityboard/checklists/templates-applied | Fires when checklist templates have been applied to an entry | $entry (array), $checklists (ChecklistCollection), $feeds (array), $form (array), $count (int) |
Lane Actions
| Hook Name | Description | Parameters |
|---|---|---|
gk/gravityboard/lane/added | Fires when a new lane is added to the board | $lane (array), $feed (array), $form (array) |
gk/gravityboard/lane/edited | Fires when a lane’s details are updated | $lane (array), $feed (array), $form (array) |
gk/gravityboard/lane/deleted | Fires when a lane is removed from the board | $lane_id (string), $feed (array), $form (array) |
gk/gravityboard/lane/moved | Fires when a lane is reordered on the board | $lane_id (string), $old_position (int), $new_position (int), $feed (array), $form (array) |
AJAX Actions
| Hook Name | Description | Parameters |
|---|---|---|
gk/gravityboard/ajax/register-routes | Allows plugins to register custom REST routes | $ajax (Ajax instance) |
Filters
Card and Data Filters
| Hook Name | Description | Parameters |
|---|---|---|
gk/gravityboard/card/update-card | Allow plugins to add additional changes to the card | $changes (array), $request (WP_REST_Request), $entry (array), $feed (array) |
gk/gravityboard/card/data | Filter the card data before it’s sent to the frontend | $card (array), $entry (array), $feed (array) |
gk/gravityboard/data/lanes | Filter the lanes data, including the cards, before it’s sent to the frontend | $lanes (array), $entries (array), $feed (array) |
Board and Rendering Filters
| Hook Name | Description | Parameters |
|---|---|---|
gk/gravityboard/board-settings | Filter the board settings before they’re passed to the frontend React application | $board_settings (array), $feed_id (int) |
gk/gravityboard/renderer/css-variable-overrides | Filter the CSS variable overrides for the board | $css_variable_overrides (array), $feed (array) |
gk/gravityboard/translation-overrides | Filter to override translations | $overrides (array) |
Feature-Specific Filters
| Hook Name | Description | Parameters |
|---|---|---|
gk/gravityboard/notes/filter-by-board | Filter whether to filter notes by board to only show notes created from the current board | $filter_notes_by_board (bool), $board_id (int) |
gk/gravityboard/checklists/export-value | Filter the export text for checklists in CSV or other export formats | $export_text (string), $checklists (ChecklistCollection) |
gk/gravityboard/merge-tags/assignee-user-id | Filter assignee user ID for merge tags | $user_id (int|null), $text (string), $form (array), $entry (array), $url_encode (bool), $esc_html (bool) |
REST API #
GravityBoard uses the WordPress REST API to fetch data. The API is available at https://your-site.com/wp-json/gravityboard/v1/boards/ .
The API is used to interact with the cards, and lanes.
Cards (Entries)
| Method | Endpoint | Description | Payload Fields (JSON) |
|---|---|---|---|
GET | /gravityboard/v1/boards/{feed_id}/cards | Retrieve all cards for the specified board. | N/A |
POST | /gravityboard/v1/boards/{feed_id}/cards | Create a new card on the specified board. |
|
PATCH | /gravityboard/v1/boards/{feed_id}/cards/{entry_id} | Update an existing card. |
|
PUT | /gravityboard/v1/boards/{feed_id}/cards/{entry_id}/move | Move a card (e.g., to a new lane or reorder within the same lane). |
|
DELETE | /gravityboard/v1/boards/{feed_id}/cards/{entry_id} | Delete a card. | N/A |
Lanes
Lane IDs are determined by the order of choices in the mapped field, starting from zero.
For example, if a field has choices: “Backlog”, “To Do”, “In Progress”, “Testing”, “Done”, the corresponding lane IDs will be 0 , 1 , 2 , 3 , 4 .
| Method | Endpoint | Description | Payload Fields (JSON) |
|---|---|---|---|
POST | /gravityboard/v1/boards/{feed_id}/lanes | Create a new lane for the specified board. | value (string): The value/name of the new lane. |
PATCH | /gravityboard/v1/boards/{feed_id}/lanes/{lane_id} | Update an existing lane’s properties (e.g., name). | value (string): The new value/name for the lane. |
PUT | /gravityboard/v1/boards/{feed_id}/lanes/{lane_id}/move | Moves a lane to a new position. The Example: To move lane |
|
DELETE | /gravityboard/v1/boards/{feed_id}/lanes/{lane_id} | Delete a lane. | N/A |
Notes
| Method | Endpoint | Description | Payload Fields (JSON) |
|---|---|---|---|
GET | /gravityboard/v1/boards/{feed_id}/cards/{entry_id}/notes | Retrieve all notes for a specific card (entry). | N/A |
POST | /gravityboard/v1/boards/{feed_id}/cards/{entry_id}/notes | Add a new note to a specific card. | note (string): The content of the note. |
PUT | /gravityboard/v1/boards/{feed_id}/cards/{entry_id}/notes/{note_id} | Update an existing note on a card. | note (string): The updated content of the note. |
DELETE | /gravityboard/v1/boards/{feed_id}/cards/{entry_id}/notes/{note_id} | Delete a note from a card. | N/A |
Attachments
| Method | Endpoint | Description | Payload Fields (Form Data) |
|---|---|---|---|
POST | /gravityboard/v1/boards/{feed_id}/cards/{entry_id}/attachments | Add a new attachment to a specific card. | file (file): The file to be uploaded. |
DELETE | /gravityboard/v1/boards/{feed_id}/cards/{entry_id}/attachments/{attachment_id} | Delete an attachment from a card. | N/A |
Checklists
| Method | Endpoint | Description | Payload Fields (JSON) |
|---|---|---|---|
GET | /gravityboard/v1/boards/{feed_id}/cards/{entry_id}/checklists | Retrieve all checklists for a specific card. | N/A |
PUT | /gravityboard/v1/boards/{feed_id}/cards/{entry_id}/checklists | Update entire checklists for a card. | checklists (array): Array of checklist objects. |
POST | /gravityboard/v1/boards/{feed_id}/cards/{entry_id}/checklists/{checklist_id}/items | Add a new checklist item to a card. | label (string): The item label. |
PUT | /gravityboard/v1/boards/{feed_id}/cards/{entry_id}/checklists/{checklist_id}/items/{item_id} | Update an existing checklist item. |
|
DELETE | /gravityboard/v1/boards/{feed_id}/cards/{entry_id}/checklists/{checklist_id}/items/{item_id} | Delete a checklist item from a card. | N/A |
Authentication
The API is authenticated using the WordPress REST API authentication method.
Permissions
The API is protected by the permissions associated with the feed; that is why the feed ID is required in the URL.