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:
- The recipient's share status is changed to
ACCEPTED. - The recipient's Keycloak account is enabled.
- The recipient is required to set a new password on next login (
UPDATE_PASSWORDrequired action). - The specified marketplace role is assigned to the recipient.
- A welcome email is sent to the recipient from the accepting admin's organization.
- An approval notification email is sent to the recipient confirming their access was granted.
Access restricted to roles:
- admin
- producer-admin
Authorization
bearer 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.
Format
uuidRequest 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": {}
}
]
}