# SCIM

{% hint style="info" %}
You might want to look at the [general SSO set-up instructions](/birdie-docs/security/saml-sso.md) first.
{% endhint %}

While you can hit the SCIM endpoints directly, the most common use case would to be use it for autoprovisioning within an IDP. This will let your IDP and Birdie stay in sync - when you assign users to Birdie in your IDP they will be provisioned in Birdie.

Please note that Birdie handles only sync of **Users**, not the **Groups**.&#x20;

#### Step 1 - Generate Token

Generate a token using your [Settings > Profile](https://app.birdie.so/user/profile) page in the section "Personal API Tokens". \
Give it a name - for instance "SCIM Token" - and make sure to save the token in a safe place as you'll only see it once.&#x20;

#### Step 2- Implement SCIM

The following provisioning features supported, with their endpoints, are:

* Create: POST <https://app.birdie.so/scim/v2/Users>
* Read: GET [https://app.birdie.so/scim/v2/Users/{id}](https://app.birdie.so/scim/v2/Users/%7Bid%7D)
* Replace: PUT [https://app.birdie.so/scim/v2/Users/{id}](https://app.birdie.so/scim/v2/Users/%7Bid%7D)
* Delete: DELETE [https://app.birdie.so/scim/v2/Users/{id}](https://app.birdie.so/scim/v2/Users/%7Bid%7D)
* Update: PATCH [https://app.birdie.so/scim/v2/Users/{id}](https://app.birdie.so/scim/v2/Users/%7Bid%7D)

#### Step 3- Schema for user email

Birdie will only use one email for each user account, if your server sends multiple email addresses when creating a new user, Birdie will first try to take <mark style="color:yellow;">`userName`</mark>, only if this attribue is a valid email.\
If userName is not an email, it will look for an email with attribute <mark style="color:yellow;">`primary:true`</mark> \
If no primary email was found, it will search for an email with attribute <mark style="color:yellow;">`type:work`</mark>\
And if no email was found with type work, it will take the first email of the list.&#x20;


---

# Agent Instructions: 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:

```
GET https://docs.birdie.so/birdie-docs/security/scim.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
