> ## Documentation Index
> Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt
> Use this file to discover all available pages before exploring further.
# Favorite Contact
>
Mark or unmark a personal contact as favorite. Works for local contacts and for Outlook contacts synced with the Microsoft Graph provider. Contacts synced with EWS keep their favorite state in Outlook, so this endpoint returns `404` with `error-contact-not-found` for those contacts.
### Changelog
| Version | Description |
| ------- | ----------- |
| 9.1.0 | Added |
## OpenAPI
````json POST /api/v1/contacts.favorite
{
"openapi": "3.0.0",
"info": {
"version": "1.0.0",
"title": "Miscellaneous"
},
"servers": [
{
"url": "https://apiexplorer.support.rocket.chat"
}
],
"tags": [
{
"name": "Commands"
},
{
"name": "Email Inbox"
},
{
"name": "Licenses"
},
{
"name": "Mailer"
},
{
"name": "Calendar Events"
},
{
"name": "Exchange"
},
{
"name": "Contacts"
},
{
"name": "WhatsApp"
},
{
"name": "Rasa App"
},
{
"name": "Jitsi App"
}
],
"paths": {
"/api/v1/contacts.favorite": {
"post": {
"summary": "Favorite Contact",
"tags": [
"Contacts"
],
"operationId": "post-api-v1-contacts.favorite",
"description": "\n\nMark or unmark a personal contact as favorite. Works for local contacts and for Outlook contacts synced with the Microsoft Graph provider. Contacts synced with EWS keep their favorite state in Outlook, so this endpoint returns `404` with `error-contact-not-found` for those contacts.\n\n### Changelog\n| Version | Description |\n| ------- | ----------- |\n| 9.1.0 | Added |",
"parameters": [
{
"$ref": "#/components/parameters/Auth-Token"
},
{
"$ref": "#/components/parameters/UserId"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"contactId",
"favorite"
],
"additionalProperties": false,
"properties": {
"contactId": {
"type": "string",
"description": "Enter the contact ID."
},
"favorite": {
"type": "boolean",
"description": "Enter `true` to favorite the contact, or `false` to remove the favorite."
}
}
},
"examples": {
"Example 1": {
"value": {
"contactId": "690c2b2d4e7e8bcf6985b3d8",
"favorite": true
}
}
}
}
}
},
"responses": {
"200": {
"$ref": "#/components/responses/trueSuccess"
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"error": {
"type": "string"
}
}
},
"examples": {
"Missing Favorite": {
"value": {
"success": false,
"error": "must have required property 'favorite' [error-invalid-params]"
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/authorizationError"
},
"403": {
"$ref": "#/components/responses/forbiddenError"
},
"404": {
"description": "Not Found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"error": {
"type": "string"
}
}
},
"examples": {
"Not Found": {
"value": {
"success": false,
"error": "error-contact-not-found"
}
}
}
}
}
}
}
}
}
},
"components": {
"parameters": {
"Auth-Token": {
"name": "X-Auth-Token",
"in": "header",
"description": "The `authToken` of the authenticated user.",
"required": true,
"schema": {
"type": "string"
},
"example": "RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f"
},
"UserId": {
"name": "X-User-Id",
"in": "header",
"description": "The `userId` of the authenticated user.",
"required": true,
"schema": {
"type": "string"
},
"example": "rbAXPnMktTFbNpwtJ"
}
},
"responses": {
"trueSuccess": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
}
},
"examples": {
"Success": {
"value": {
"success": true
}
}
}
}
}
},
"authorizationError": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"error": {
"type": "string"
}
}
},
"examples": {
"Authorization Error": {
"value": {
"success": false,
"error": "You must be logged in to do this."
}
}
}
}
}
},
"forbiddenError": {
"description": "Forbidden",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"error": {
"type": "string"
},
"errorType": {
"type": "string"
}
}
},
"examples": {
"Permission Error": {
"value": {
"success": false,
"error": "User does not have the permissions required for this action",
"errorType": "error-forbidden"
}
}
}
}
}
}
}
}
}
````