curl --request POST \
--url https://api.example.com/profile/switch-organization \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"organizationId": "<string>"
}
'{
"accessToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4...",
"expiresIn": 3600
}
Trocar o contexto da organizacao ativa e receber novos tokens com escopo da organizacao selecionada.
curl --request POST \
--url https://api.example.com/profile/switch-organization \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"organizationId": "<string>"
}
'{
"accessToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4...",
"expiresIn": 3600
}
curl -X POST https://api.awsales.io/studio/profile/switch-organization \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"organizationId": "019525fd-4c38-7e30-a5c1-b6e3f4d8a9c2"
}'
{
"accessToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4...",
"expiresIn": 3600
}
| Status | Codigo | Descricao |
|---|---|---|
400 | validation_error | Entrada invalida ou campos obrigatorios ausentes |
401 | unauthorized | Autenticacao ausente ou invalida |
403 | forbidden | Permissoes insuficientes |
404 | organization.not_found | Organizacao nao encontrada |
500 | internal_server_error | Ocorreu um erro inesperado |