Skip to content

AI Connections Developer Setup

Use AI Connections to enable the connection, register your app, and obtain any required approvals. Ask the site administrator for the URLs shown in Advanced details. Use them exactly as published, including any subdirectory, mapped domain, port, or rest_route query string.

Download the OpenAPI contract. Its referenced JSON Schemas are served alongside it, including the shared types. The contract uses synthetic examples and the daytidy-agent/v1 REST namespace.

After the site opts into public booking access, you can list published offerings, query availability, and create price quotes without a customer grant. Booking creation, a customer’s booking details, cancellations, and owner data require the applicable delegated grant. A quote does not reserve capacity.

  1. Register the app’s exact HTTPS callback and the scopes it will request. Public clients use a client ID. Confidential clients also authenticate at token and revocation endpoints with client_secret_basic. Store that secret on the app’s server.
  2. Discover the OAuth endpoints through the site’s authorization server and protected resource metadata. Start the authorization code flow in the browser with a PKCE S256 challenge, unpredictable state, the registered callback, requested scopes, and the exact resource URL for this connection.
  3. Check the returned state and issuer. Exchange the one-use code with the PKCE verifier, registered callback, and the same resource URL. Supply the client ID in the form body for a public client. A confidential client supplies its identity in the HTTP Basic credentials.
  4. Send access tokens only in the Authorization: Bearer … header over HTTPS. Keep REST, A2A, and MCP grants separate. Refresh with the same resource and replace the refresh token with the returned token.

Customer scopes include bookings.create, bookings.read.own, and bookings.cancel.own. A grant allows an app to ask for a specific booking or cancellation. To complete the action, send the approval request, open its first_party_url for the user, and submit the approved command with the required idempotency key. Poll the returned operation if pending. Follow Retry-After when present.

In Customer Booking, enable public booking access and publish the discovery link. Copy the generated Agent Card URL under Advanced details. Dedicated domains may also expose /.well-known/agent-card.json. Shared-domain Multisite blogs use their generated Card URLs.

  1. Fetch the Card from the verified business site and use the interface URL it advertises.
  2. Send JSON-RPC requests with A2A-Version: 1.0. For SendMessage, send one ROLE_USER message with one JSON data part and a stable message ID. Use the DayTidy A2A command schema for offering, availability, quote, and booking inputs.
  3. To book, obtain an A2A grant with bookings.create using the A2A interface URL as the OAuth resource. Open the approval link in the customer’s browser. Continue the same task with the returned task ID, approval ID, original booking input, and idempotency key. Keep the message ID for an exact retry.
  4. If the operation is pending, poll the original task. A completed task can include a checkout link for an unpaid booking.

Use Check discovery link to check the Card, metadata, and a read-only request. Client support for A2A and DayTidy’s commands determines whether the assistant can use the connection.

Owner access requires active DayTidy Pro, a current WordPress user with the relevant permissions, and an approved owner grant. Owner REST runs independently of MCP. MCP requires WordPress 6.9 or later with the Abilities API and WordPress MCP Adapter 0.7.1. Enable it in Owner Access (Pro) if your client uses MCP.

Approved scopeREST endpointMCP tool
schedule.readGET /owner/scheduledaytidy-owner-schedule
reports.readGET /owner/reports/summarydaytidy-owner-report
bookings.manage.cancelPOST /owner/bookings/{booking_id}/cancellation-preview, then approval and cancellationdaytidy-preview-admin-cancellation, then approval and cancellation tools

Use a separate OAuth grant for each interface. Treat an owner’s offering and resource restrictions as the maximum allowed access. Use the site’s timezone to calculate schedule and report intervals. To cancel a single booking, create a fresh preview, obtain the owner’s approval for that preview, then submit the approved cancellation. The OpenAPI contract lists the REST request shapes and MCP tool mappings.

For stale or rejected credentials, check the resource URL and whether the site administrator or user revoked access. If the public endpoints fail, ask the administrator to verify HTTPS, metadata routing, and the status in AI Connections.