switchOrganization
Requires an authenticated session.
Signs the person in to another organization they belong to, matched by email, and returns new tokens for it. Refused when they have no account there.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation SwitchOrganization($switchOrganizationInput: SwitchOrganizationInput!) {
switchOrganization(switchOrganizationInput: $switchOrganizationInput) {
accessToken
expiresIn
mustChangePassword
organizationId
partnerId
refreshToken
organization {
id
code
postalCode
registrationNumber
name
status
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation SwitchOrganization($switchOrganizationInput: SwitchOrganizationInput!) {\n switchOrganization(switchOrganizationInput: $switchOrganizationInput) {\n accessToken\n expiresIn\n mustChangePassword\n organizationId\n partnerId\n refreshToken\n organization {\n id\n code\n postalCode\n registrationNumber\n name\n status\n }\n }\n}",
"variables": {
"switchOrganizationInput": {
"organizationId": "string"
}
}
}
EOF
Variables:
{
"switchOrganizationInput": {
"organizationId": "string"
}
}
Response:
{
"data": {
"switchOrganization": {
"accessToken": "string",
"expiresIn": 0,
"mustChangePassword": true,
"organizationId": "string",
"partnerId": "string",
"refreshToken": "string",
"organization": {
"id": "string",
"code": "string",
"postalCode": "string",
"registrationNumber": "string",
"name": "string",
"status": "string"
}
}
}
}
switchOrganization(
switchOrganizationInput: SwitchOrganizationInput!
): AuthResponse!
Arguments
switchOrganization.switchOrganizationInput ● SwitchOrganizationInput! non-null input
The organization to switch to.
Type
AuthResponse object
The result of a sign in.