Mental health care in Brazil's Unified Health System (SUS) has been organized in psychosocial healthcare networks (RAPS), seeking integration among different health services. However, the level of implementation and the extension of mental healthcare networks vary in Brazil's municipalities. Despite that, each local network's performance remain unknown, especially regarding the pattern and effects of relations between services. This thesis' objective was to evaluate the integration between RAPS' primary and specialized care components, in the municipalities of Campinas and Fortaleza. The research performed a systematic review (narrative synthesis), a health information system analysis and a cross-sectional study, from the AcesSUS project: "Projeto AcesSUS -Inquérito sobre o acesso a partir da atenção básica, o funcionamento e a utilização da atenção especializada para quatro condições traçadoras em quatro grandes cidades brasileiras". The results were discussed in four papers. The first paper presents a systematic review of pathways to mental health (MH) care in Brazil. In this paper, we argue that the performance of primary care and the management of acute episodes and urgencies are the main challenges in the country's mental health pathways. The second paper compares MH actions in primary care in the cities of Campinas, Fortaleza, Porto Alegre and São Paulo. In this paper, we compare data regarding different processes in primary care that, despite being interconnected, reveal effects from the local healthcare network arrangements. The third paper analyses the clinical pathways to community mental health services (CAPS) in Campinas and Fortaleza. The paper highlights the importance of primary care and general hospitals in Campinas' system, and the weight of primary care and psychiatric hospitals in Fortaleza. These results show mixed models of patient flow regulation, combining stepped care access from primary care and direct regulation by specialized services. The study also points out, in both municipalities, a correlation between direct access to the CAPS and white patients, and between the service where the MH issue was first detected and the source of referral to the CAPS. In Campinas, the study also shows an association between access via primary care and higher age, and between direct access to the CAPS and lack of previous psychiatric medication usage. The final paper presents the prevalence and associated factors for receiving MH treatment in primary care, for patients currently being treated at the CAPS in Campinas and Fortaleza. The occurrence of treatment in primary care is associated with having primary care as the source of referral to the CAPS, and with the initial detection having occurred at this level of care (even after controlling for source of referral). Similar associations were found in scenarios of high and low availability of primary care interventions in MH. From the different angles of analysis provided by each paper, we explored varied aspects of the RAPS, highlighting dynamic process...