Skip to content

Conversation

gziolo
Copy link
Member

@gziolo gziolo commented Sep 16, 2025

Closes #28.

Documents the available REST API endpoints and how to use them for registered abilities.

Covers three routes available:

  • fetching all abilities
  • fetching a single ability
  • executing a single ability

This is a first pass generated and iterated with Claude Code.

@gziolo gziolo self-assigned this Sep 16, 2025
@gziolo gziolo added the [Type] Developer Documentation Improvements or additions to documentation label Sep 16, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive REST API documentation for the WordPress Abilities API, documenting how external systems can discover and execute abilities via HTTP requests. The documentation covers the three main endpoints for interacting with abilities: listing all abilities, retrieving a specific ability, and executing an ability.

  • Documents the REST API schema and ability object structure
  • Provides detailed endpoint definitions with examples for GET and POST requests
  • Includes authentication methods and error response documentation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@gziolo gziolo mentioned this pull request Sep 16, 2025
Copy link

codecov bot commented Sep 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.33%. Comparing base (94d950a) to head (c0ffb6c).
⚠️ Report is 1 commits behind head on trunk.

Additional details and impacted files
@@            Coverage Diff            @@
##              trunk      #77   +/-   ##
=========================================
  Coverage     83.33%   83.33%           
  Complexity       96       96           
=========================================
  Files             8        8           
  Lines           516      516           
=========================================
  Hits            430      430           
  Misses           86       86           
Flag Coverage Δ
unit 83.33% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gziolo gziolo marked this pull request as ready for review September 17, 2025 07:39
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: gziolo <[email protected]>
Co-authored-by: jonathanbossenger <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@jonathanbossenger
Copy link
Contributor

@gziolo quick question, from my local testing it appears that all Abilities API REST Endpoints require authentication, is this correct? Want to make sure of my facts before adding review comments.

@gziolo
Copy link
Member Author

gziolo commented Sep 17, 2025

quick question, from my local testing it appears that all Abilities API REST Endpoints require authentication, is this correct? Want to make sure of my facts before adding review comments.

I had to double-check, but the answer is:

  • to get all abilities or a single ability current_user_can( 'read' ) check is performed, so the user needs to be authorized
  • to run an ability, it all depends on the ability itself and what permission it defined

@johnbillion, any thoughts about the current approach to permissions when calling the REST API endpoints?

Copy link
Contributor

@jonathanbossenger jonathanbossenger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor suggestion, but otherwise it all looks good, and checks out.

Added user access information for Abilities API.
@gziolo gziolo merged commit e48d165 into trunk Sep 19, 2025
20 checks passed
@gziolo gziolo deleted the add/rest-api-docs branch September 19, 2025 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Developer Documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document REST API usage
2 participants