> ## 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.

# Set Email Inbox

> Configure the Omnichannel email inbox for your server.

Permissions required:- `manage-email-inbox`
### Changelog
| Version      | Description |
| ---------------- | ------------|
|3.11.0-rc.0         | Added       |

## OpenAPI

````json POST /api/v1/email-inbox
{
  "openapi": "3.0.0",
  "info": {
    "version": "1.0.0",
    "title": "Miscellaneous"
  },
  "servers": [
    {
      "url": "https://apiexplorer.support.rocket.chat"
    }
  ],
  "paths": {
    "/api/v1/email-inbox": {
      "post": {
        "tags": [
          "Email Inbox"
        ],
        "summary": "Set Email Inbox",
        "description": "Configure the Omnichannel email inbox for your server.\n\nPermissions required:- `manage-email-inbox`\n### Changelog\n| Version      | Description |\n| ---------------- | ------------|\n|3.11.0-rc.0         | Added       |",
        "operationId": "post-api-v1-email-inbox",
        "parameters": [
          {
            "$ref": "#/components/parameters/Auth-Token"
          },
          {
            "$ref": "#/components/parameters/UserId"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "_id": {
                    "type": "string",
                    "description": "Email Id"
                  },
                  "name": {
                    "type": "string",
                    "description": "The name you wish to set for your email."
                  },
                  "email": {
                    "type": "string",
                    "description": "The email to be used"
                  },
                  "active": {
                    "type": "boolean",
                    "description": "Set whether or not the email is active."
                  },
                  "description": {
                    "type": "string",
                    "description": "The description for this entry."
                  },
                  "senderInfo": {
                    "type": "string",
                    "description": "Sender info to be attached on outgoing emails."
                  },
                  "department": {
                    "type": "string",
                    "description": "The department to which the email will be available."
                  },
                  "smtp": {
                    "type": "object",
                    "description": "An object with your SMTP credentials to be used for outgoing emails.",
                    "properties": {
                      "password": {
                        "type": "string"
                      },
                      "port": {
                        "type": "integer"
                      },
                      "secure": {
                        "type": "boolean"
                      },
                      "server": {
                        "type": "string"
                      },
                      "username": {
                        "type": "string"
                      }
                    }
                  },
                  "imap": {
                    "type": "object",
                    "description": "An object having your IMAP credentials to be used for incomming emails.",
                    "properties": {
                      "password": {
                        "type": "string"
                      },
                      "port": {
                        "type": "integer"
                      },
                      "secure": {
                        "type": "boolean"
                      },
                      "server": {
                        "type": "string"
                      },
                      "username": {
                        "type": "string"
                      }
                    }
                  }
                },
                "required": [
                  "name",
                  "email",
                  "active",
                  "smtp",
                  "imap"
                ]
              },
              "examples": {
                "Example": {
                  "value": {
                    "name": "new email",
                    "email": "mdyemaasil@rocket.chat",
                    "active": "false",
                    "description": "This email has been set",
                    "senderInfo": "email sender",
                    "department": "awesome department",
                    "smtp": {
                      "password": "10fae4dc374fb87d",
                      "port": "25",
                      "secure": "true",
                      "server": "smtp.mailtrap.io",
                      "username": "b5ef5safd6cb806c"
                    },
                    "imap": {
                      "password": "10fae4374sdfb87d",
                      "port": "993",
                      "secure": "true",
                      "server": "imap.mailtrap.io",
                      "username": "b5ef5aafd6cb806c"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "success": {
                      "type": "boolean"
                    }
                  }
                },
                "examples": {
                  "Success": {
                    "value": {
                      "_id": "JdVkn_dkOlms_",
                      "success": "true"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                },
                "examples": {
                  "Duplicate": {
                    "value": {
                      "success": "false",
                      "error": "E11000 duplicate key error index: rocketchat.rocketchat_email_inbox.$email_1 dup key: { : \"mdyemail@rocket.chat\" }"
                    }
                  },
                  "Invalid Inbox": {
                    "value": {
                      "success": "false",
                      "error": "error-invalid-email-inbox"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/authorizationError"
          },
          "403": {
            "$ref": "#/components/responses/forbiddenError"
          }
        }
      }
    }
  },
  "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": {
      "authorizationError": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "examples": {
              "Authorization Error": {
                "value": {
                  "status": "error",
                  "message": "You must be logged in to do this."
                }
              }
            }
          }
        }
      },
      "forbiddenError": {
        "description": "Forbidden",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                },
                "error": {
                  "type": "string"
                }
              }
            },
            "examples": {
              "Permission Error": {
                "value": {
                  "success": "false",
                  "error": "User does not have the permissions required for this action [error-unauthorized]"
                }
              }
            }
          }
        }
      }
    }
  }
}
````

