# Add Or Update

This endpoint will create a new profile into the selected bot. If the profile already exists, it will update the permission matrix using the supplied one.

Updating the profiles permission matrix will change the permissions associated to all team members using that profile on their next login to the platform.

### Request

The following request will add a new operator to the bot specified in the authorization token. If the operator already exist it will be updated with the supplied permissions list.

```bash
curl --location --request POST 'https://<SERVICE ENDPOINT>/teams/profiles' \
--header 'Authorization: Bearer <BOT_AUTH_TOKEN>' \
--header 'Content-Type: application/json'
--data-raw '{
    "Id":"<profile id or null>",
    "Name":"My Profile",
    "Description":"Description",
    "Permissions":{
        ...
    }
}'
```

You can set any of the following flags (as true or false) in the permissions property of the model. Unspecified permissions will default to false value.

|                             |
| --------------------------- |
| AssignConversation          |
| ControlConversation         |
| EditAI                      |
| EditBroadcasts              |
| EditChatbot                 |
| ExportReports               |
| ForgetConversation          |
| PublishChatbot              |
| RunBroadcasts               |
| ViewAI                      |
| ViewBroadcasts              |
| ViewChatbotDesigner         |
| ViewConversation            |
| ViewGroupConversation       |
| ViewReportingDashboard      |
| EditDatabase                |
| ViewDatabase                |
| ViewContactDetails          |
| UnlockReference             |
| BackupChatbot               |
| CanShareAConversation       |
| EditAudience                |
| ViewConversationVariables   |
| ViewCustomConversationPanel |

### Response

If successful, the response will simply have a standard 200 OK code.

### Response Codes

This endpoint will reply with the following standard HTTP codes.

| Code | Meaning                                                                                        |
| ---- | ---------------------------------------------------------------------------------------------- |
| 200  | Ok. The request has been successfully fulfilled.                                               |
| 400  | Bad Request. The supplied authorization token is invalid or the team member cannot be created. |
| 404  | Not Found. The specified chatbot has not been found.                                           |


---

# 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.xenioo.com/xenioo-api/globa-platform-api/teams/profiles/add-or-update.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.
