Python SDK
import json
import os
from parable_types_web_api import InviteTenantUserInput
from parable_web_api_sdk import ClientConfig, WebApiSDK
sdk = WebApiSDK(
ClientConfig(
base_url=os.environ["PARABLE_API_URL"],
auth_token=os.environ["PARABLE_API_TOKEN"],
default_headers={"X-Tenant": os.environ["PARABLE_WORKSPACE"]},
)
)
input_data = InviteTenantUserInput.model_validate(
json.loads("{\"email\":\"person@example.com\",\"roleIds\":[]}"),
)
result = sdk.users.invite_user(input_data)sdk, err := webapisdk.New(webapisdk.SDKConfig{
BaseURL: os.Getenv("PARABLE_API_URL"),
Auth: &webapisdk.AuthConfig{Token: os.Getenv("PARABLE_API_TOKEN")},
RequestInterceptor: func(ctx context.Context, req *http.Request) error {
req.Header.Set("X-Tenant", os.Getenv("PARABLE_WORKSPACE"))
return nil
},
})
if err != nil {
return err
}
var input webapitypes.InviteTenantUserInput
if err := json.Unmarshal([]byte(`{"email":"person@example.com","roleIds":[]}`), &input); err != nil {
return err
}
result, err := sdk.UsersNamespace.InviteUser(ctx, input){
"data": {
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"email": "jsmith@example.com",
"id": "<string>",
"staffRoles": [
{
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"id": "<string>",
"kind": "internal",
"name": "<string>",
"permissions": [
"<string>"
],
"sortOrder": 0,
"caution": "<string>",
"description": "<string>",
"icon": "<string>",
"parentRoleId": "<string>"
}
],
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>",
"avatarUrl": "<string>",
"locale": "<string>",
"name": "<string>",
"timezone": "<string>",
"title": "<string>",
"userOnboardingCompletedAt": "2023-11-07T05:31:56Z",
"welcomeSeenAt": "2023-11-07T05:31:56Z"
},
"meta": {
"requestId": "<string>",
"totalCount": 123
},
"links": {
"first": "<string>",
"last": "<string>",
"next": "<string>",
"prev": "<string>"
}
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}Invite someone to the Workspace
Emails an invitation to join this Workspace with the roles you choose. Accepting it gives that person access, so it needs a person’s approval.
POST
/
api
/
users
/
invitations
Python SDK
import json
import os
from parable_types_web_api import InviteTenantUserInput
from parable_web_api_sdk import ClientConfig, WebApiSDK
sdk = WebApiSDK(
ClientConfig(
base_url=os.environ["PARABLE_API_URL"],
auth_token=os.environ["PARABLE_API_TOKEN"],
default_headers={"X-Tenant": os.environ["PARABLE_WORKSPACE"]},
)
)
input_data = InviteTenantUserInput.model_validate(
json.loads("{\"email\":\"person@example.com\",\"roleIds\":[]}"),
)
result = sdk.users.invite_user(input_data)sdk, err := webapisdk.New(webapisdk.SDKConfig{
BaseURL: os.Getenv("PARABLE_API_URL"),
Auth: &webapisdk.AuthConfig{Token: os.Getenv("PARABLE_API_TOKEN")},
RequestInterceptor: func(ctx context.Context, req *http.Request) error {
req.Header.Set("X-Tenant", os.Getenv("PARABLE_WORKSPACE"))
return nil
},
})
if err != nil {
return err
}
var input webapitypes.InviteTenantUserInput
if err := json.Unmarshal([]byte(`{"email":"person@example.com","roleIds":[]}`), &input); err != nil {
return err
}
result, err := sdk.UsersNamespace.InviteUser(ctx, input){
"data": {
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"email": "jsmith@example.com",
"id": "<string>",
"staffRoles": [
{
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"id": "<string>",
"kind": "internal",
"name": "<string>",
"permissions": [
"<string>"
],
"sortOrder": 0,
"caution": "<string>",
"description": "<string>",
"icon": "<string>",
"parentRoleId": "<string>"
}
],
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>",
"avatarUrl": "<string>",
"locale": "<string>",
"name": "<string>",
"timezone": "<string>",
"title": "<string>",
"userOnboardingCompletedAt": "2023-11-07T05:31:56Z",
"welcomeSeenAt": "2023-11-07T05:31:56Z"
},
"meta": {
"requestId": "<string>",
"totalCount": 123
},
"links": {
"first": "<string>",
"last": "<string>",
"next": "<string>",
"prev": "<string>"
}
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}Access
This operation needs a Parable token. An MCP token cannot call it. See Authentication for the kinds of token. Your roles must granttenant.user.create.
Errors
HTTP 422: The invitation input is invalid, such as missing roles or an ineligible person. Provide a valid person and at least one assignable role.HTTP 403: You cannot invite people or assign the requested roles in this Workspace. Choose roles within your authority or ask a Workspace administrator.WA-TN-003: Parable manages who is a member of this Workspace, so nobody can be invited or reactivated in it. Ask your Parable representative to give the person access.
Authorizations
Headers
Body
application/json