Python SDK
import json
import os
from parable_types_web_api import InviteUserWithDefaultRoleInput
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 = InviteUserWithDefaultRoleInput.model_validate(
json.loads("{\"email\":\"person@example.com\"}"),
)
result = sdk.users.invite_user_with_default_role(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.InviteUserWithDefaultRoleInput
if err := json.Unmarshal([]byte(`{"email":"person@example.com"}`), &input); err != nil {
return err
}
result, err := sdk.UsersNamespace.InviteUserWithDefaultRole(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 with the default role
Emails an invitation to join this Workspace with the Workspace’s default role, the role set under Protection, Login. Accepting it gives that person access, so it needs a person’s approval. Only a person can invite someone with other roles.
POST
/
api
/
users
/
invitations
/
default-role
Python SDK
import json
import os
from parable_types_web_api import InviteUserWithDefaultRoleInput
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 = InviteUserWithDefaultRoleInput.model_validate(
json.loads("{\"email\":\"person@example.com\"}"),
)
result = sdk.users.invite_user_with_default_role(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.InviteUserWithDefaultRoleInput
if err := json.Unmarshal([]byte(`{"email":"person@example.com"}`), &input); err != nil {
return err
}
result, err := sdk.UsersNamespace.InviteUserWithDefaultRole(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
WA-AU-036: The Workspace has no default role to give. Ask a Workspace manager to choose the default role under Protection, Login.HTTP 422: The invitation input is invalid, such as an ineligible person. Provide the email of someone who is not already a member.HTTP 403: You cannot invite people or give the default role in this Workspace. 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