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>",
"name": "<string>",
"permissions": [
"<string>"
],
"description": "<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.
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>",
"name": "<string>",
"permissions": [
"<string>"
],
"description": "<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
A personal access token, which starts with pat_. A Parable token can call each operation that the roles of its owner allow. An MCP token can call only the read operations that are open to agents. A SQL token does not work on this API.
Headers
Workspace slug. Overrides subdomain-based workspace resolution when provided.
"acme"
Optional request correlation ID echoed back in the response.
"550e8400-e29b-41d4-a716-446655440000"
Body
An invitation that gives the Workspace's default role, the one an agent sends. It names no roles: only a person chooses those.
An email address
255^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$