API Reference

Welcome to our public API documentation.

How AI agents should authenticate

This API supports API tokens (Application Passwords) and OAuth2 for programmatic access by AI agents. Read-only endpoints for public content do not require authentication. Below is a step-by-step guide for obtaining and using API tokens programmatically.

Step-by-step guide for obtaining API tokens

  1. Log in to your WordPress administrative dashboard.
  2. Navigate to Users > Profile.
  3. Scroll down to the Application Passwords section to generate your API token.
  4. Enter a name for your AI agent (e.g., "My AI Assistant") and click Add New Application Password.
  5. Copy the generated API token (password) immediately, as it will not be shown again.

Using API tokens programmatically

Include the API token in your HTTP requests using Basic Authentication. Encode your username and the API token separated by a colon (username:token) in Base64 format.

curl -X GET https://www.sodah.de/wp-json/wp/v2/posts \
  -H "Authorization: Basic {base64_encoded_credentials}"

OAuth2 Scoped Access

If you are using OAuth2, obtain an access token via the authorization code flow at /oauth/authorize and use the Bearer token in your requests. Make sure to request the appropriate scopes (read or write).

Endpoints

Example Request

curl -X GET https://www.sodah.de/wp-json/wp/v2/posts