Developers

Build with Welley

You can use the Welley API to build clients, scripts, community tools and integrations. The live Swagger reference describes the operations and schemas you can use.

MCPModel Context Protocol

Connect an AI agent

Welley has an MCP server, so an AI agent such as Claude, Codex or Cursor can work with your Welley account. Add the server to your agent and sign in with Welley. Then ask about your groups and feeds, or ask the agent to post, reply or plan an event for you. The agent acts as you, so it can do only what you can do.

server
https://welley.social/mcp
transport
Streamable HTTP
sign-in
OAuth, client ID welley-mcp, no client secret
lasts
7 days, then you sign in again
signed out
your agent can still search the API and read public posts

Your agent

Claude, Codex, Cursor, Gemini and others

MCP

welley.social/mcp

  • overview
  • find
  • call
HTTPS

Welley API

Posts, groups, events, messages and server settings

Your agent doesn't load the whole API. It searches for the operation it needs, then runs only that one.
ToolWhat it does
overview()Says what the API can do, area by area.
find(query)Finds the right operation from plain words, such as “reply to a post”.
call(operation_id, params, body, mode)Describes, checks or runs one operation. Only mode: "execute" sends a real request.

Add Welley to your agent

Claude Code

terminal
claude mcp add --transport http --client-id welley-mcp welley https://welley.social/mcp
claude mcp login welley
  1. Your browser opens. Sign in to Welley and approve the connection.
  2. On a computer without a browser, add --no-browser to the login command and open the link it prints on another device. Then paste the address that the browser ends on.

Watch an agent at work

This is a real session in Claude Code. Maya is a member of Riverside Garden, a community garden group. She connects Welley, asks what she missed, and then asks the agent to answer a question for her. The group reviews new posts before they go up, so her reply waits for a moderator.

~/garden $ claude mcp add --transport http --client-id welley-mcp welley https://welley.social/mcp
Added HTTP MCP server welley with URL: https://welley.social/mcp to local config
 
~/garden $ claude mcp login welley --no-browser
Starting authentication for "welley"…
Visit this URL to authorize:
  https://welley.social/oauth/authorize?response_type=code&client_id=welley-mcp&code_challenge=…
 
Waiting for authorization… (^C to cancel)
Or paste the redirect URL here:
 
# Maya opens the link, signs in to Welley and clicks Allow.
 
~/garden $ claude
 
> What's new in Riverside Garden lately? Is there a question nobody has answered yet?
 
⏺ welley - find (MCP)(query: "community feed recent posts and unanswered questions")
  ⎿  {"status":"task_not_finished_yet","candidates":[{"operationId":"get_api_v1_pos…
 
⏺ Riverside Garden is likely a group. Let me try the group feed with intent to resolve the id.
 
⏺ welley - call (MCP)(operation_id: "get_api_v1_groups_groupid_feed", mode: "execute")
  ⎿  {"ok":false,"operationId":"get_api_v1_groups_groupid_feed","error":{"type":"va…
 
⏺ welley - call (MCP)(operation_id: "get_api_v1_groups_search", params: {"query": "Riverside Garden"}, mode: "execute")
  ⎿  {"ok":false,"operationId":"get_api_v1_groups_search","error":{"type":"validati…
 
⏺ welley - call (MCP)(operation_id: "get_api_v1_groups_search", params: {"substring": "Riverside Garden"}, mode: "execute")
  ⎿  {"status":200,"body":{"groups":[{"groupId":"gr_01m4y6errre80b2101wdbn7kfm","gr…
 
⏺ welley - call (MCP)(operation_id: "get_api_v1_groups_groupid_feed", params: {"groupId": "gr_01m4y6errre80b2101wdbn7kfm", "limit": 30, "includeComments": true, "includePublisher": true}, mode: "execute")
  ⎿  {"status":200,"body":[{"id":"pt_01m67821z8e0qv7eqtf4jb44n3","uri":"https://wel…
 
⏺ The group has 22 posts but the feed returned only 7, so some channels may be missing. I'll look up the group's channels.
 
⏺ welley - find (MCP)(query: "list channels of a group")
  ⎿  {"status":"task_not_finished_yet","candidates":[{"operationId":"get_api_v1_gro…
 
⏺ welley - call (MCP)(operation_id: "get_api_v1_groups_groupid_channels", params: {"groupId": "gr_01m4y6errre80b2101wdbn7kfm"}, mode: "execute")
  ⎿  {"status":200,"body":[{"id":"gc_01m4y6nfrheyeszr37r94fh9r7","username":"rivers…
 
⏺ Questions most likely live in the "Growing advice" forum channel, which isn't in the main feed. Let me fetch its posts.
 
⏺ welley - call (MCP)(operation_id: "get_api_v1_posts", mode: "describe")
  ⎿  {"operationId":"get_api_v1_posts","method":"GET","path":"/api/v1/posts","title…
 
⏺ Pulling the forum posts (all forum categories) plus the volunteering channel in parallel.
 
⏺ welley - call (MCP)(operation_id: "get_api_v1_posts", params: {"groupId": "gr_01m4y6errre80b2101wdbn7kfm", "channelAppMeta": "welley.group.forum", "limit": 30, "htmlContent": "false"}, mode: "execute")
  ⎿  {"status":200,"body":[{"id":"pt_01m4y6wn9sejw9pyb4kkpf4fet","uri":"https://wel…
 
⏺ welley - call (MCP)(operation_id: "get_api_v1_posts", params: {"ownerId": "gc_01m4y6ndqte0naxpd23nxj2zpd", "limit": 20, "htmlContent": "false"}, mode: "execute")
  ⎿  {"status":200,"body":[{"id":"pt_01m6781k5weasa5819xvhzcxwy","uri":"https://wel…
 
⏺ Riverside Garden has been quiet since Oct 30. Nobody has posted in the last six days. And yes, there's one question with no replies.
  
  Recent activity (Oct 30)
  - Water shut-off on Nov 15 (Alex Morgan, Announcements): take your hoses home or hang them in the shed before then. That's 10 days away.
  - Garlic for bed 4 is in (Maya Chen): three kinds from the seed library. It gets planted Saturday, after the compost work.
  - First harvest from bed 12 (Noah Bennett): two pounds of cherry tomatoes. It got 4 likes and 2 comments.
  - Watering shifts (Elena Ruiz, Volunteering): Elena will do Tuesdays until the water goes off and asked if anyone needs Thursday covered. One person has replied.
  
  Older posts still around (Oct 14)
  - Saturday workday plan (Garden projects): 9:00 at the main gate. Turn the compost, mulch the paths, plant the garlic. It has 2 replies.
  - Second compost bay (Sam Rivera): needs about 8 pallets, wire and two people for an afternoon. It has 1 reply.
  - Aphids on the kale in bed 7 (Maya Chen, Growing advice): asks about companion planting. It has 1 reply.
  - Spring seed exchange: March 14 in the community room.
  
  The question nobody has answered
  "When should we sow the fava beans?", posted by Sam Rivera in Growing advice on Oct 14. It has no replies, one 👍 and one view. Sam says the October sowing came through winter well, but the March sowing gave a bigger harvest, and asks if anyone has notes from earlier seasons. If anyone is going to sow this fall, now is the time, so a reply would help soon.
  
  I only read the public channels. I didn't open Staff discussion or Chess, which are private.
 
> Answer Sam for me: we sowed half in late October and half in March last year. The October ones flowered first, but the March ones gave more pods, so I'd do both again.
 
⏺ welley - find (MCP)(query: "reply to a post (create comment)")
  ⎿  {"status":"task_not_finished_yet","candidates":[{"operationId":"post_api_v1_po…
 
⏺ welley - call (MCP)(operation_id: "post_api_v1_posts_postid_comments", params: {"postId": "pt_01m4y6wgw9eve9me2bzs0dap01"}, body_json: {"text": "We sowed half in late October and half in March last year. The October ones flowered first, but the March ones gave more pods, so I'd do both again.", "privacy": "PUBLIC", "kind": "Note"}, mode: "execute")
  ⎿  {"status":202,"body":{"id":"pp_01m6pe5xzde5yttak8e857qfqs","groupId":"gr_01m4y…
 
⏺ The server accepted the reply but marked it as pending. I'll check whether it has gone live.
 
⏺ welley - find (MCP)(query: "get comments of a post", limit: 3)
  ⎿  {"status":"task_not_finished_yet","candidates":[{"operationId":"get_api_v1_pos…
 
⏺ welley - call (MCP)(operation_id: "get_api_v1_posts_postid_comments", params: {"postId": "pt_01m4y6wgw9eve9me2bzs0dap01", "htmlContent": "false"}, mode: "execute")
  ⎿  {"status":200,"body":[],"request":{"operationId":"get_api_v1_posts_postid_comm…
 
⏺ welley - call (MCP)(operation_id: "get_api_v1_posts_postid_comments", params: {"postId": "pt_01m4y6wgw9eve9me2bzs0dap01", "htmlContent": "false"}, mode: "execute")
  ⎿  {"status":200,"body":[],"request":{"operationId":"get_api_v1_posts_postid_comm…
 
⏺ I sent your reply to Sam's fava bean question, but it isn't showing in the thread yet.
  
  The reply is under your account (Maya Chen) in Growing advice:
  
  > We sowed half in late October and half in March last year. The October ones flowered first, but the March ones gave more pods, so I'd do both again.
  
  Welley accepted it and marked it pending (pending post id pp_01m6pe5xzde5yttak8e857qfqs). I checked the thread twice right after, and both times it still had no comments. It may still be processing, or the group may have to approve it first. If it doesn't appear within a few minutes, look at the post in Growing advice. I can check it again for you if you like.
 
> 

Start with a public request

The API runs over HTTPS, and most operations take and return JSON. Public read operations can work without an account.

Read server information

This request returns public metadata about the server. It doesn't change any server data.

curl --fail --silent --show-error "https://welley.social/api/v1/instance"

Look up the operation in Swagger

Before you write a client, check its parameters, request schema, response schema and permissions.

Authenticate an integration

Protected operations need a valid token in the Authorization header. Our official CLI sends the token with the Bearer prefix.

Read your effective server permissions

Set WELLEY_TOKEN to your own valid token, the way you usually handle secrets. This example only reads data.

curl --fail --silent --show-error \ -H "Authorization: Bearer $WELLEY_TOKEN" \ "https://welley.social/api/v1/rbac/permissions"
  • For an integration, create a personal access token in your account settings.
  • Give it a name and an expiration. The API also accepts expiresInDays=0 for a token with no stored expiration.
  • Limit which global permissions, group permissions and groups the token can use.
  • If you leave an allow-list empty, that field is limited only by your current access. A token can't give rights that you don't have.
  • You'll see the token secret only once. Save it before you close the creation result.
  • To manage tokens, you need an account login session. A personal access token can't create, list, copy or revoke tokens.

Check permissions and scope

Authentication tells the API who's calling. Role permissions decide which operations that caller can use.

  • The API returns 401 when a protected request has no valid authentication.
  • The API returns 403 when the caller doesn't have a required permission.
  • Permission names follow Resource.Action, for example GroupSettings.Manage.
  • For scoped webhook and permission operations, leave out scope to use server scope. For group scope, pass a group TypeId.
  • Read the description of each operation. Some endpoints use HTTP signatures or another protocol instead of an account token.

Choose an API area

The reference covers social features, integrations and server administration. The examples here are just a small part of the API.

Accounts and profiles

Read profiles, manage account identities and use the account export or move operations.

MethodPathOperationAccess
GET/api/v1/usersRead a local or remote profile by username.Public or optional token
POST/api/v1/usersAdd another profile to the current account, up to the server's limit.Token required

Posts and feeds

Read feeds and create posts. Other operations handle replies, polls, reactions, drafts and saved posts.

MethodPathOperationAccess
GET/api/v1/postsRead public posts as a guest, or a personalized feed when you're authenticated.Public or optional token
POST/api/v1/postsCreate a post with its content and who can see it.Token required

Groups and events

Build community tools with groups, membership, channels, moderation and events.

MethodPathOperationAccess
POST/api/v1/groupsCreate a group, using the permissions of the authenticated user.Token required
GET/api/v1/eventsList public events or the events the authenticated user can see.Public or optional token
POST/api/v1/eventsCreate an event. A group event needs GroupEvents.Create.Token required

Conversations and notifications

Read conversation rooms and their messages. Read notification collections and update whether they're read.

MethodPathOperationAccess
GET/api/v1/roomsList the current user's rooms. To continue the list, use nextCursor from the response body.Token required
GET/api/v1/user-notificationsList the current user's notifications.Token required

Webhooks and AI agents

Connect outside services with webhooks. Set up AI agents through the agent APIs.

MethodPathOperationAccess
GET/api/v1/webhooks/eventsGet the list of supported webhook event types.Token required
POST/api/v1/webhooksCreate a webhook in a server or group scope you have permission for. The HTTP signing secret is shown only once.Token required
GET/api/v1/ai-agentsList the AI agents the caller can see.Token required

Server and group administration

Use the API for settings, reports, moderation, federation controls, quotas and deployment administration.

MethodPathOperationAccess
GET/api/v1/rbac/permissionsRead the effective permissions for the current user and scope.Token required
GET/api/v1/settingsRead platform settings, if the account has the required permissions.Public or optional token

Handle responses and media

Follow each operation's own pagination and upload flow.

  • For cursor feeds, follow the pagination links the server returns. Don't build cursors from guesses about IDs.
  • Rooms return an opaque nextCursor in the response body. When you continue the list, keep the same filters.
  • To upload media, create an upload entry, then send the content to the URL it returns.
  • Check each operation's error responses and limits. Even a documented operation can need a role, a server configuration or an external provider.