SweetConnect LogoSweetConnect
ApiShare documents

Accept a share recipient

Approves a pending share recipient, enabling their Keycloak account and granting them access to the shared documents.

Preconditions:

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

Side effects on success:

  1. The recipient's share status is changed to ACCEPTED.
  2. The recipient's Keycloak account is enabled.
  3. The recipient is required to set a new password on next login (UPDATE_PASSWORD required action).
  4. The specified marketplace role is assigned to the recipient.
  5. A welcome email is sent to the recipient from the accepting admin's organization.
  6. An approval notification email is sent to the recipient confirming their access was granted.

Access restricted to roles:

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

In: header

Path Parameters

userId*string

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

Formatuuid

Request Body

application/json

Marketplace role to assign to the accepted recipient

TypeScript Definitions

Use the request body type in TypeScript.

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/accept" \  -H "Content-Type: application/json" \  -d '{    "marketplaceRole": "technician"  }'
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": {}
    }
  ]
}