Overview
PUT/blocks/{userId}blocks

Block a user (idempotent; severs any friendship between the pair)

Creates the caller→user block. Blocking removes any existing friendship or pending request between the two users in the same transaction, and new friend requests are refused (403) while a block exists in either direction. Follows are untouched — they carry no permission weight. Idempotent — repeating the call returns the existing block (200) instead of creating a second row.

Auth: bearerAuth — calls run as the authenticated user.

Parameters
  • userIdpathstring
Responses
200

The already-existing block

  • idstring
  • ecosystemIdstring
  • blockerIdstring
  • blockedIdstring
  • createdAtstring
Example
{
  "id": "string",
  "ecosystemId": "string",
  "blockerId": "string",
  "blockedId": "string",
  "createdAt": "string"
}
201

The created block

  • idstring
  • ecosystemIdstring
  • blockerIdstring
  • blockedIdstring
  • createdAtstring
Example
{
  "id": "string",
  "ecosystemId": "string",
  "blockerId": "string",
  "blockedId": "string",
  "createdAt": "string"
}
400

Error

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

Error

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

Error

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

Error

  • erroroptionalobject
Example
{
  "error": {
    "message": "string",
    "code": "string"
  }
}
Code examples
cURL
curl -X PUT "https://api.agenticdeveloperhub.com/blocks/{userId}" \
  -H "Authorization: Bearer YOUR_TOKEN"
JavaScript
const res = await fetch("https://api.agenticdeveloperhub.com/blocks/{userId}", {
  method: "PUT",
  headers: {
    "Authorization": "Bearer YOUR_TOKEN"
  },
});
const data = await res.json();