Overview
POST/communities/{id}/memberscommunity

Grant a membership role (community admin only; idempotent upsert; the grantee must be a real customer → 404)

Create a record in members.

Auth: bearerAuth — calls run as the authenticated user.

Parameters
  • idpathstring
Request body

application/json · optional

  • customerIdstring
  • role"admin" | "moderator" | "member"
Example
{
  "customerId": "string",
  "role": "admin"
}
Responses
201

The granted membership row

  • communityIdstring
  • customerIdstring
  • rolestring

    owner | admin | moderator | member

  • biooptionalstring?

    The member’s one-line "what I’m building" intro for this community.

  • createdAtstring
  • updatedAtstring
Example
{
  "communityId": "string",
  "customerId": "string",
  "role": "string",
  "bio": "string",
  "createdAt": "string",
  "updatedAt": "string"
}
400

Error

  • erroroptionalobject
Example
{
  "error": {
    "message": "string",
    "code": "string"
  }
}
401

Error

  • erroroptionalobject
Example
{
  "error": {
    "message": "string",
    "code": "string"
  }
}
403

Error

  • erroroptionalobject
Example
{
  "error": {
    "message": "string",
    "code": "string"
  }
}
404

Error

  • erroroptionalobject
Example
{
  "error": {
    "message": "string",
    "code": "string"
  }
}
Code examples
cURL
curl -X POST "https://api.agenticdeveloperhub.com/communities/{id}/members" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "customerId": "string",
  "role": "admin"
}'
JavaScript
const res = await fetch("https://api.agenticdeveloperhub.com/communities/{id}/members", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_TOKEN",
    "Content-Type": "application/json"
  },
  body: "{\n  \"customerId\": \"string\",\n  \"role\": \"admin\"\n}",
});
const data = await res.json();