---
updatedAt: 2025-09-09T23:55:56.000Z
agentTools:
  projectIndex: https://docs.ns-api.com/llms.txt
---

# Add a Answerrule for a User

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "NetSapiens API v2",
    "description": "",
    "version": "1.0.0"
  },
  "tags": [
    {
      "name": "Answer Rules"
    }
  ],
  "paths": {
    "/domains/{domain}/users/{user}/answerrules": {
      "post": {
        "summary": "Add a Answerrule for a User",
        "deprecated": false,
        "description": "",
        "tags": [
          "Answer Rules"
        ],
        "parameters": [
          {
            "name": "domain",
            "in": "path",
            "description": "",
            "required": true,
            "example": "{{domain}}",
            "schema": {
              "$ref": "#/components/schemas/DomainNamePath"
            }
          },
          {
            "name": "user",
            "in": "path",
            "description": "",
            "required": true,
            "example": "{{user}}",
            "schema": {
              "$ref": "#/components/schemas/UserNamePath"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "x-apidog-refs": {
                  "01H5TQ6VEDMJMDYNQCDE4A6VBF": {
                    "$ref": "#/components/schemas/Answerrule"
                  }
                },
                "x-apidog-orders": [
                  "synchronous",
                  "01H5TQ6VEDMJMDYNQCDE4A6VBF"
                ],
                "properties": {
                  "synchronous": {
                    "$ref": "#/components/schemas/Synchronous"
                  },
                  "time-frame": {
                    "type": "string",
                    "description": "This is the timeframe that also is needed to make this set of answer rules unique. * is teh default and if no timeframes are setup this is is how to set anserrules. "
                  },
                  "enabled": {
                    "description": "When enabled  this setting will turn on voicemail for the user.  ",
                    "$ref": "#/components/schemas/YesNoStringYesDefault"
                  },
                  "is-active": {
                    "type": "boolean",
                    "readOnly": true,
                    "description": "This is read only option that will be true if this timeframe is active for this user when taking into account current settings, date/time and all timeframes. "
                  },
                  "order": {
                    "type": "integer",
                    "description": "This is to allow for a priority based order of different timeframes. The default is to add it in value higher (lower priority) than the lowest priority timeframe. Timeframe * will get 99 if not already set. ",
                    "minimum": 0,
                    "default": 99,
                    "readOnly": true
                  },
                  "simultaneous-ring": {
                    "description": "This is a feature that will allow multiple phones or remote extensions to be called at the same time. ",
                    "$ref": "#/components/schemas/AnswerruleFeatureSimRing"
                  },
                  "do-not-disturb": {
                    "description": "When enabled this feature will block all inbound ringing and send the call to voicemails if enabled. ",
                    "type": "object",
                    "x-apidog-refs": {
                      "01H8X4QS3BVN7HDAXVAY816SEW": {
                        "$ref": "#/components/schemas/AnswerruleFeature",
                        "x-apidog-overrides": {
                          "parameters": null
                        }
                      }
                    },
                    "x-apidog-orders": [
                      "01H8X4QS3BVN7HDAXVAY816SEW"
                    ],
                    "properties": {
                      "enabled": {
                        "description": "This setting when enable will request caller id blocking on outbound calls requesting privacy settings.  This may lower the ability to connect certain calls if not setup properly to support privacy settings. ",
                        "$ref": "#/components/schemas/YesNoStringNoDefault"
                      }
                    },
                    "required": [
                      "enabled"
                    ],
                    "x-apidog-ignore-properties": [
                      "enabled"
                    ]
                  },
                  "forward-always": {
                    "$ref": "#/components/schemas/AnswerruleFeature",
                    "x-apidog-overrides": {
                      "parameters": null
                    }
                  },
                  "forward-on-active": {
                    "$ref": "#/components/schemas/AnswerruleFeature",
                    "x-apidog-overrides": {
                      "parameters": null
                    }
                  },
                  "forward-on-busy": {
                    "$ref": "#/components/schemas/AnswerruleFeature",
                    "x-apidog-overrides": {
                      "parameters": null
                    }
                  },
                  "forward-no-answer": {
                    "$ref": "#/components/schemas/AnswerruleFeature",
                    "x-apidog-overrides": {
                      "parameters": null
                    }
                  },
                  "forward-when-unregistered": {
                    "$ref": "#/components/schemas/AnswerruleFeature",
                    "x-apidog-overrides": {
                      "parameters": null
                    }
                  },
                  "forward-on-dnd": {
                    "$ref": "#/components/schemas/AnswerruleFeature",
                    "x-apidog-overrides": {
                      "parameters": null
                    }
                  },
                  "forward-on-spam-call": {
                    "$ref": "#/components/schemas/AnswerruleFeature",
                    "x-apidog-overrides": {
                      "parameters": null
                    }
                  },
                  "call-screening": {
                    "description": "When enabled this feature will enable the call screening application asking the caller to record their name before attempting the connection based on other answer rules. ",
                    "type": "object",
                    "x-apidog-refs": {
                      "01H8X6307HQPM6K4J6J41KXWA1": {
                        "$ref": "#/components/schemas/AnswerruleFeature",
                        "x-apidog-overrides": {
                          "parameters": null
                        }
                      }
                    },
                    "x-apidog-orders": [
                      "01H8X6307HQPM6K4J6J41KXWA1"
                    ],
                    "properties": {
                      "enabled": {
                        "description": "This setting when enable will request caller id blocking on outbound calls requesting privacy settings.  This may lower the ability to connect certain calls if not setup properly to support privacy settings. ",
                        "$ref": "#/components/schemas/YesNoStringNoDefault"
                      }
                    },
                    "required": [
                      "enabled"
                    ],
                    "x-apidog-ignore-properties": [
                      "enabled"
                    ]
                  },
                  "phone-numbers-to-allow": {
                    "description": "This is a list of numbers that would be allowed bypassing features like do-not-disturb and call-screening.",
                    "$ref": "#/components/schemas/AnswerruleFeatureWithRemove"
                  },
                  "new-position": {
                    "type": "string",
                    "writeOnly": true,
                    "enum": [
                      "top",
                      "bottom"
                    ],
                    "examples": [
                      "top",
                      "bottom"
                    ],
                    "description": "This will move the answerrule to the top or bottom in the priority list. Top having the most priority, and bottom having the least priority",
                    "x-apidog-enum": [
                      {
                        "name": "",
                        "value": "top",
                        "description": "When inputting \"top\", this will move the answerrule to the first place in the priority list of answerrules"
                      },
                      {
                        "name": "",
                        "value": "bottom",
                        "description": "When inputting \"bottom\", this will move the answerrule to the last place in the priority list of answerrules"
                      }
                    ]
                  },
                  "phone-numbers-to-reject": {
                    "description": "This is a list of numbers that would be allowed bypassing features like do-not-disturb and call-screening.",
                    "$ref": "#/components/schemas/AnswerruleFeatureWithRemove"
                  }
                },
                "required": [
                  "synchronous",
                  "time-frame",
                  "enabled",
                  "is-active"
                ],
                "x-apidog-ignore-properties": [
                  "time-frame",
                  "enabled",
                  "is-active",
                  "order",
                  "simultaneous-ring",
                  "do-not-disturb",
                  "forward-always",
                  "forward-on-active",
                  "forward-on-busy",
                  "forward-no-answer",
                  "forward-when-unregistered",
                  "forward-on-dnd",
                  "forward-on-spam-call",
                  "call-screening",
                  "phone-numbers-to-allow",
                  "new-position",
                  "phone-numbers-to-reject"
                ]
              },
              "example": {
                "time-frame": "Vacation",
                "enabled": "yes",
                "forward-always": {
                  "enabled": "no",
                  "parameters": [
                    18587645226
                  ]
                },
                "forward-on-busy": {
                  "enabled": "no",
                  "parameters": []
                },
                "do-not-disturb": {
                  "enabled": "no"
                },
                "forward-when-unregistered": {
                  "enabled": "yes",
                  "parameters": [
                    18585551354
                  ]
                },
                "phone-numbers-to-reject": {
                  "enabled": "yes",
                  "parameters": [
                    "anonymous",
                    "unknown"
                  ]
                },
                "forward-on-active": {
                  "enabled": "no",
                  "parameters": [
                    12545666,
                    "id adipisicing est veniam",
                    "ad"
                  ]
                },
                "forward-no-answer": {
                  "enabled": "no",
                  "parameters": [
                    6154343
                  ]
                },
                "forward-on-spam-call": {
                  "enabled": "yes",
                  "parameters": [
                    "vmail_1000"
                  ]
                },
                "call-screening": {
                  "enabled": "no"
                },
                "simultaneous-ring": {
                  "enabled": "no",
                  "parameters": [
                    1234,
                    3245,
                    "1231wp",
                    18587645200
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {},
                  "x-apidog-orders": [],
                  "x-apidog-ignore-properties": []
                }
              }
            },
            "headers": {},
            "x-apidog-name": "Accepted"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "x-apidog-folder": "Answer Rules",
        "x-apidog-status": "released",
        "x-run-in-apidog": "https://apidog.com/web/project/374090/apis/api-4683956-run"
      }
    }
  },
  "components": {
    "schemas": {
      "Answerrule": {
        "type": "object",
        "properties": {
          "domain": {
            "$ref": "#/components/schemas/DomainName"
          },
          "user": {
            "$ref": "#/components/schemas/UserName"
          },
          "time-frame": {
            "type": "string",
            "description": "This is the timeframe that also is needed to make this set of answer rules unique. * is teh default and if no timeframes are setup this is is how to set anserrules. "
          },
          "enabled": {
            "description": "When enabled  this setting will turn on voicemail for the user.  ",
            "$ref": "#/components/schemas/YesNoStringYesDefault"
          },
          "is-active": {
            "type": "boolean",
            "readOnly": true,
            "description": "This is read only option that will be true if this timeframe is active for this user when taking into account current settings, date/time and all timeframes. "
          },
          "order": {
            "type": "integer",
            "description": "This is to allow for a priority based order of different timeframes. The default is to add it in value higher (lower priority) than the lowest priority timeframe. Timeframe * will get 99 if not already set. ",
            "minimum": 0,
            "default": 99,
            "readOnly": true
          },
          "simultaneous-ring": {
            "description": "This is a feature that will allow multiple phones or remote extensions to be called at the same time. ",
            "$ref": "#/components/schemas/AnswerruleFeatureSimRing"
          },
          "do-not-disturb": {
            "description": "When enabled this feature will block all inbound ringing and send the call to voicemails if enabled. ",
            "type": "object",
            "x-apidog-refs": {
              "01H8X4QS3BVN7HDAXVAY816SEW": {
                "$ref": "#/components/schemas/AnswerruleFeature",
                "x-apidog-overrides": {
                  "parameters": null
                }
              }
            },
            "x-apidog-orders": [
              "01H8X4QS3BVN7HDAXVAY816SEW"
            ],
            "properties": {
              "enabled": {
                "description": "This setting when enable will request caller id blocking on outbound calls requesting privacy settings.  This may lower the ability to connect certain calls if not setup properly to support privacy settings. ",
                "$ref": "#/components/schemas/YesNoStringNoDefault"
              }
            },
            "required": [
              "enabled"
            ],
            "x-apidog-ignore-properties": [
              "enabled"
            ]
          },
          "forward-always": {
            "$ref": "#/components/schemas/AnswerruleFeature",
            "x-apidog-overrides": {
              "parameters": null
            }
          },
          "forward-on-active": {
            "$ref": "#/components/schemas/AnswerruleFeature",
            "x-apidog-overrides": {
              "parameters": null
            }
          },
          "forward-on-busy": {
            "$ref": "#/components/schemas/AnswerruleFeature",
            "x-apidog-overrides": {
              "parameters": null
            }
          },
          "forward-no-answer": {
            "$ref": "#/components/schemas/AnswerruleFeature",
            "x-apidog-overrides": {
              "parameters": null
            }
          },
          "forward-when-unregistered": {
            "$ref": "#/components/schemas/AnswerruleFeature",
            "x-apidog-overrides": {
              "parameters": null
            }
          },
          "forward-on-dnd": {
            "$ref": "#/components/schemas/AnswerruleFeature",
            "x-apidog-overrides": {
              "parameters": null
            }
          },
          "forward-on-spam-call": {
            "$ref": "#/components/schemas/AnswerruleFeature",
            "x-apidog-overrides": {
              "parameters": null
            }
          },
          "call-screening": {
            "description": "When enabled this feature will enable the call screening application asking the caller to record their name before attempting the connection based on other answer rules. ",
            "type": "object",
            "x-apidog-refs": {
              "01H8X6307HQPM6K4J6J41KXWA1": {
                "$ref": "#/components/schemas/AnswerruleFeature",
                "x-apidog-overrides": {
                  "parameters": null
                }
              }
            },
            "x-apidog-orders": [
              "01H8X6307HQPM6K4J6J41KXWA1"
            ],
            "properties": {
              "enabled": {
                "description": "This setting when enable will request caller id blocking on outbound calls requesting privacy settings.  This may lower the ability to connect certain calls if not setup properly to support privacy settings. ",
                "$ref": "#/components/schemas/YesNoStringNoDefault"
              }
            },
            "required": [
              "enabled"
            ],
            "x-apidog-ignore-properties": [
              "enabled"
            ]
          },
          "phone-numbers-to-allow": {
            "description": "This is a list of numbers that would be allowed bypassing features like do-not-disturb and call-screening.",
            "$ref": "#/components/schemas/AnswerruleFeatureWithRemove"
          },
          "new-position": {
            "type": "string",
            "writeOnly": true,
            "enum": [
              "top",
              "bottom"
            ],
            "examples": [
              "top",
              "bottom"
            ],
            "description": "This will move the answerrule to the top or bottom in the priority list. Top having the most priority, and bottom having the least priority",
            "x-apidog-enum": [
              {
                "name": "",
                "value": "top",
                "description": "When inputting \"top\", this will move the answerrule to the first place in the priority list of answerrules"
              },
              {
                "name": "",
                "value": "bottom",
                "description": "When inputting \"bottom\", this will move the answerrule to the last place in the priority list of answerrules"
              }
            ]
          },
          "phone-numbers-to-reject": {
            "description": "This is a list of numbers that would be allowed bypassing features like do-not-disturb and call-screening.",
            "$ref": "#/components/schemas/AnswerruleFeatureWithRemove"
          },
          "time_range_data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Timerange"
            },
            "readOnly": true
          }
        },
        "required": [
          "domain",
          "user",
          "time-frame",
          "is-active",
          "enabled"
        ],
        "x-apidog-orders": [
          "domain",
          "user",
          "time-frame",
          "enabled",
          "is-active",
          "order",
          "simultaneous-ring",
          "do-not-disturb",
          "forward-always",
          "forward-on-active",
          "forward-on-busy",
          "forward-no-answer",
          "forward-when-unregistered",
          "forward-on-dnd",
          "forward-on-spam-call",
          "call-screening",
          "phone-numbers-to-allow",
          "new-position",
          "phone-numbers-to-reject",
          "time_range_data"
        ],
        "x-apidog-ignore-properties": [],
        "x-apidog-folder": "Schemas"
      },
      "AnswerruleFeature": {
        "type": "object",
        "properties": {
          "enabled": {
            "description": "This setting when enable will request caller id blocking on outbound calls requesting privacy settings.  This may lower the ability to connect certain calls if not setup properly to support privacy settings. ",
            "$ref": "#/components/schemas/YesNoStringNoDefault"
          },
          "parameters": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string",
                  "examples": [
                    "park_1234",
                    "user_5555",
                    "queue_234",
                    "aa_AutoAttendantName",
                    "vmail_5555",
                    "phone_5555"
                  ]
                },
                {
                  "type": "number",
                  "examples": [
                    1234,
                    18005551234
                  ]
                }
              ]
            },
            "description": "This field will provide the values needed to configure the parent feature. These values could be multiple strings or numbers.  "
          }
        },
        "x-apidog-orders": [
          "enabled",
          "parameters"
        ],
        "required": [
          "enabled"
        ],
        "x-apidog-ignore-properties": [],
        "x-apidog-folder": "Schemas"
      },
      "AnswerruleFeatureWithRemove": {
        "type": "object",
        "properties": {
          "enabled": {
            "description": "This setting when enable will request caller id blocking on outbound calls requesting privacy settings.  This may lower the ability to connect certain calls if not setup properly to support privacy settings. ",
            "$ref": "#/components/schemas/YesNoStringNoDefault"
          },
          "parameters": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string",
                  "examples": [
                    "park_1234"
                  ]
                },
                {
                  "type": "number",
                  "examples": [
                    18005551234
                  ]
                }
              ]
            },
            "description": "This field will provide the values needed to configure the parent feature. These values could be multiple strings or numbers.  "
          }
        },
        "x-apidog-orders": [
          "enabled",
          "parameters"
        ],
        "x-apidog-ignore-properties": [],
        "x-apidog-folder": "Schemas"
      },
      "AnswerruleFeatureSimRing": {
        "type": "object",
        "properties": {
          "enabled": {
            "description": "This setting when enable will request caller id blocking on outbound calls requesting privacy settings.  This may lower the ability to connect certain calls if not setup properly to support privacy settings. ",
            "$ref": "#/components/schemas/YesNoStringNoDefault"
          },
          "parameters": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string",
                  "examples": [
                    "1234wp",
                    "3456;delay=15",
                    "confirm_18005551234;delay=20",
                    "<OwnDevices>"
                  ]
                },
                {
                  "type": "number",
                  "examples": [
                    1234,
                    18005551234
                  ]
                }
              ]
            },
            "description": "This field will provide the values needed to configure the parent feature. These values could be multiple strings or numbers.  "
          }
        },
        "x-apidog-orders": [
          "enabled",
          "parameters"
        ],
        "required": [
          "enabled"
        ],
        "x-apidog-ignore-properties": [],
        "x-apidog-folder": "Schemas"
      },
      "Timerange": {
        "type": "object",
        "properties": {
          "ordinal-order": {
            "type": "integer",
            "description": "This will be a unique index and orger for the specific timerange inside of the given timeframe. "
          },
          "start-date": {
            "type": "string",
            "description": "This is field will be set for the start of a calender based time range in the format of YYYY-MM-DD. To disable the start of a range use \"now\". ",
            "format": "date",
            "examples": [
              "2023-08-20",
              "now"
            ]
          },
          "end-date": {
            "type": "string",
            "description": "This is field will be set for the end of a calender based time range in the format of YYYY-MM-DD. To disable the start of a range use \"never\". ",
            "format": "date",
            "examples": [
              "2023-09-15",
              "never"
            ]
          },
          "day-of-week-number": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 6,
                "description": "Integer can be used 0-6 for day in week. "
              },
              {
                "type": "string",
                "default": "*",
                "examples": [
                  "*"
                ],
                "description": "String of * can be used for all days."
              }
            ],
            "description": "This is field will be set for a specific day of the week ( 0-6 / Sunday - Saturday) for this given time range. * would be used for all days of the week. "
          },
          "start-time": {
            "type": "string",
            "format": "time",
            "default": "00:00",
            "examples": [
              "00:00",
              "10:00"
            ],
            "description": "This is the time in HH:MM format for the given time range. This will be the start of the window and will be based on the user's time-zone. "
          },
          "end-time": {
            "type": "string",
            "format": "time",
            "default": "23:59",
            "examples": [
              "23:59",
              "12:59"
            ],
            "description": "This is the time in HH:MM format for the given time range. This will be the end of the window and will be based on the user's time-zone. "
          },
          "invert-match": {
            "description": "This setting when enable will request caller id blocking on outbound calls requesting privacy settings.  This may lower the ability to connect certain calls if not setup properly to support privacy settings. ",
            "$ref": "#/components/schemas/YesNoStringNoDefault"
          }
        },
        "x-apidog-orders": [
          "ordinal-order",
          "start-date",
          "end-date",
          "day-of-week-number",
          "start-time",
          "end-time",
          "invert-match"
        ],
        "required": [
          "day-of-week-number"
        ],
        "x-apidog-ignore-properties": [],
        "x-apidog-folder": "Schemas"
      },
      "YesNoStringYesDefault": {
        "type": "string",
        "enum": [
          "yes",
          "no"
        ],
        "x-apidog": {
          "enumDescriptions": {
            "yes": "Yes",
            "no": "No"
          }
        },
        "default": "yes",
        "x-apidog-folder": "Enums"
      },
      "YesNoStringNoDefault": {
        "type": "string",
        "enum": [
          "yes",
          "no"
        ],
        "x-apidog": {
          "enumDescriptions": {
            "yes": "Yes",
            "no": "No"
          }
        },
        "default": "no",
        "x-apidog-folder": "Enums"
      },
      "DomainName": {
        "type": "string",
        "description": "This is the main organization name. This is used to link resource to its group/tenant/organization/enterprise. ~ and * can be used alone in special cases to mean My Domain (~) and All Domains (\\*). ",
        "pattern": "^[A-Za-z0-9._-]+|\\*",
        "maxLength": 64,
        "examples": [
          "example.com"
        ],
        "x-apidog-folder": "Enums"
      },
      "DomainNamePath": {
        "type": "string",
        "description": "This is the main organization name. This is used to link resource to its group/tenant/organization/enterprise. Then using in path for GET you can set to \"~\" to use the domain name linked to your token/key instead of the domain name itself when reading for your own domain.  ",
        "pattern": "^[A-Za-z0-9._-]*|~|\\*+",
        "maxLength": 64,
        "examples": [
          "example.com",
          "myDomain",
          "test.12123"
        ],
        "default": "~",
        "x-apidog-folder": "Enums"
      },
      "UserName": {
        "type": "string",
        "examples": [
          "1000",
          "200"
        ],
        "description": "This is the main user extension for the user account. ",
        "x-apidog-folder": "Enums"
      },
      "UserNamePath": {
        "type": "string",
        "description": "This is the main user extension for the user account. ~ can be used to mean \"my account\" which will extract the user from the token/key used for authentication. ",
        "examples": [
          "1000",
          "200",
          "~"
        ],
        "minLength": 0,
        "maxLength": 16,
        "default": "~",
        "x-apidog-folder": "Enums"
      },
      "Synchronous": {
        "type": "string",
        "enum": [
          "yes",
          "no"
        ],
        "x-apidog": {
          "enumDescriptions": {
            "yes": "",
            "no": ""
          }
        },
        "writeOnly": true,
        "default": "no",
        "description": "When synchronous is requested with \"yes\" the response will be a 200 on success and will contain a valid JSON representiation of the new resource. If no or left off request a 202 \"Accepted\" will be given in a success case and this can be considered a success. Synchronous responses will be a little slower as the API will process the geo replication request and wait till the local copy has been written and can be read back berfore sending a response. ",
        "x-apidog-folder": "Enums"
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      },
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "servers": [
    {
      "url": "https://{server}/ns-api/v2",
      "description": "Dynamic Environment",
      "variables": {
        "server": {
          "default": "ns-api.com"
        }
      }
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ]
}
```