SweetConnect LogoSweetConnect
ApiShare documents

Decline a share recipient

Declines a pending share recipient, deleting their Keycloak account and revoking access to the shared documents.

Preconditions:

  • The caller's organization must match the recipient's organization — cross-organization decline is not permitted.

Side effects on success:

  1. The recipient's share status is changed to DECLINED.
  2. The recipient's Keycloak account is deleted.
  3. A decline notification email is sent to the recipient.

Access restricted to roles:

  • admin
  • producer-admin
POST
/v1/shares/{userId}/decline
AuthorizationBearer <token>

In: header

Path Parameters

userId*string

UUID of the share recipient to decline. This is the Keycloak user ID of the pending recipient.

Formatuuid

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://dev.sweetconnect.io/api/storage/v1/shares/a1b2c3d4-5678-90ab-cdef-1234567890ab/decline"
Empty
{
  "errors": [
    {
      "errorCode": "BadRequest",
      "message": "The request payload is invalid.",
      "extension": {}
    }
  ]
}
{
  "errors": [
    {
      "errorCode": "Unauthorized",
      "message": "Authentication is required to access this resource.",
      "extension": {}
    }
  ]
}
{
  "errors": [
    {
      "errorCode": "NoPermission",
      "message": "You do not have permission to access this resource.",
      "extension": {}
    }
  ]
}
{
  "errors": [
    {
      "errorCode": "NotFound",
      "message": "The requested resource was not found.",
      "extension": {}
    }
  ]
}
{
  "errors": [
    {
      "errorCode": "UnprocessableEntity",
      "message": "Operation not allowed for this entity type.",
      "extension": {
        "entityType": "Document"
      }
    }
  ]
}
{
  "errors": [
    {
      "errorCode": "InternalServerError",
      "message": "An unexpected error occurred. See logs for further details or create a support ticket.",
      "extension": {}
    }
  ]
}