> For the complete documentation index, see [llms.txt](https://developers.mobilic.beta.gouv.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.mobilic.beta.gouv.fr/guides/authentification/jetons-lies-a-un-rattachement/rattachement-des-employes-a-la-societe.md).

# Rattachement  des employés à la société

Une fois que le logiciel est relié à la société, il est possible d'effectuer des requêtes API afin de solliciter les employés à accorder au logiciel les droits d'accès à leur compte Mobilic.

Pour cela, il faut faire un appel au endpoint [/protected](/guides/authentification/jetons-lies-a-un-rattachement.md#endpoint-protected) avec la liste des employés que l'on souhaite rattacher :

```graphql
mutation {
    company{
        syncEmployment(companyId: 58, employees: [
                 {firstName:"Prénom_test1",
                  lastName:"Nom_test1",
                  email:"email-salarie1@gmail.com"},
                 {firstName:"Prénom_test2",
                  lastName:"Nom_test2",
                  email:"email-salarie2@gmail.com"}]){
            id
            email
            user{
                firstName
                lastName
            }
        }
    }
}
```

Les salariés concernés recevront un email leur demandant d'[autoriser votre logiciel à accéder à leur compte.](https://faq.mobilic.beta.gouv.fr/je-suis-salarie/autoriser-lacces-a-un-logiciel-tiers#comment-donner-acces-a-mon-compte-mobilic-a-un-editeur-tiers)

Si vous avez déjà envoyé une demande de rattachement à un salarié, il n'en recevra pas de nouvelles, sauf si sa précédente demande est expirée (Au bout de 7 jours).

Vous recevrez en retour la liste de tous les salariés ayant été invités à rejoindre l'entreprise et à vous ouvrir leur accès.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers.mobilic.beta.gouv.fr/guides/authentification/jetons-lies-a-un-rattachement/rattachement-des-employes-a-la-societe.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
