cURL
curl --request POST \ --url https://api-sandbox.rinne.com.br/core/v1/auth/select-company \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "company_id": "507f1f77bcf86cd799439011" } '
{ "user": { "id": "user123", "identifiers": [ { "id": "id1", "type": "email", "value": "[email protected]", "verified": true, "created_at": "2024-01-01T00:00:00.000Z", "verified_at": "2024-01-01T01:00:00.000Z" } ], "primary_identifier": { "id": "id1", "type": "email", "value": "[email protected]", "verified": true, "created_at": "2024-01-01T00:00:00.000Z", "verified_at": "2024-01-01T01:00:00.000Z" }, "auth_methods": [ "password" ], "created_at": "2024-01-01T00:00:00.000Z", "updated_at": "2024-01-01T00:00:00.000Z", "roles": [ { "id": "a3dbd0c2-9f79-4f86-8caa-47779b3f2793", "name": "admin", "permissions": [ "user.create", "user.read", "role.create" ], "created_at": "2024-01-01T00:00:00.000Z", "updated_at": "2024-01-01T00:00:00.000Z", "description": "Administrator role with full access", "company_id": "a3dbd0c2-9f79-4f86-8caa-47779b3f2793", "organization_id": "a3dbd0c2-9f79-4f86-8caa-47779b3f2794" } ], "first_name": "John", "last_name": "Doe", "suspended_at": "2024-01-01T00:00:00.000Z", "metadata": {} }, "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "expires_at": "2024-01-02T00:00:00.000Z", "selected_company": { "id": "a3dbd0c2-9f79-4f86-8caa-47779b3f2793", "name": "My Company", "role": "admin" } }
Selects company context for authenticated user and returns new JWT token with company-specific permissions. Used after login when user has multiple companies.
JWT token for user authentication
Company ID to select
"507f1f77bcf86cd799439011"
Company selected successfully
Show child attributes
JWT authentication token
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
Token expiration timestamp
"2024-01-02T00:00:00.000Z"