curl --request POST \
--url https://api.example.com/organizations/{organizationId}/memberships \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"userId": "<string>",
"roleSlug": "<string>"
}
'{
"membershipId": "om_01HQZC8G2T9YX5J8VQBW3KPQR7",
"userId": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"organizationId": "019525fd-4c38-7e30-a5c1-b6e3f4d8a9c2",
"role": {
"slug": "member"
},
"status": "ACTIVE",
"createdAt": "2026-03-25T14:00:00.000Z",
"updatedAt": "2026-03-25T14:00:00.000Z"
}
Adicionar um usuario a organizacao criando uma nova membership com um role atribuido.
curl --request POST \
--url https://api.example.com/organizations/{organizationId}/memberships \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"userId": "<string>",
"roleSlug": "<string>"
}
'{
"membershipId": "om_01HQZC8G2T9YX5J8VQBW3KPQR7",
"userId": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"organizationId": "019525fd-4c38-7e30-a5c1-b6e3f4d8a9c2",
"role": {
"slug": "member"
},
"status": "ACTIVE",
"createdAt": "2026-03-25T14:00:00.000Z",
"updatedAt": "2026-03-25T14:00:00.000Z"
}
curl -X POST https://api.awsales.io/studio/organizations/ORG_ID/memberships \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"userId": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"roleSlug": "member"
}'
memberships:write.{
"membershipId": "om_01HQZC8G2T9YX5J8VQBW3KPQR7",
"userId": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"organizationId": "019525fd-4c38-7e30-a5c1-b6e3f4d8a9c2",
"role": {
"slug": "member"
},
"status": "ACTIVE",
"createdAt": "2026-03-25T14:00:00.000Z",
"updatedAt": "2026-03-25T14:00:00.000Z"
}
| 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 |
409 | membership.already_exists | Membership ja existe para este usuario |
500 | internal_server_error | Ocorreu um erro inesperado |