# Get SIP Account Restrictions

Get the restrictions set for the given SIP Account.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Sip Accounts API",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api.cm.com"
    }
  ],
  "paths": {
    "/voice-sipaccountsapi/v1/{accountGuid}/sipaccounts/{sipAccountGuid}/restrictions": {
      "get": {
        "tags": [
          "Restrictions"
        ],
        "summary": "Get SIP Account Restrictions",
        "description": "Get the restrictions set for the given SIP Account.",
        "parameters": [
          {
            "name": "accountGuid",
            "in": "path",
            "description": "Unique identifier of the Logical Account or Voice Account.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "00000000-0000-0000-0000-000000000000"
          },
          {
            "name": "sipAccountGuid",
            "in": "path",
            "description": "Unique identifier of the SIP Account.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "00000000-0000-0000-0000-000000000000"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiRestriction"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorCollection"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorCollection"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApiRestriction": {
        "title": "Restriction",
        "type": "object",
        "properties": {
          "username": {
            "type": "string",
            "description": "Username of the SIP Account.",
            "nullable": true,
            "example": "MySIPAccount"
          },
          "prefix": {
            "type": "string",
            "description": "Phone number prefix affected by the restriction.",
            "nullable": true,
            "example": "3176"
          },
          "restrictionType": {
            "$ref": "#/components/schemas/RestrictionType"
          },
          "forcedByCm": {
            "type": "boolean",
            "description": "Whether this restriction was created and enforced by CM or not. This value cannot be set or updated via the API."
          }
        },
        "additionalProperties": false,
        "description": "A whitelist or blaclist based restriction that can be placed on a SIP Account."
      },
      "Error": {
        "title": "Error",
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true
          },
          "source": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ErrorCollection": {
        "title": "Error Collection",
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string",
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Error"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "RestrictionType": {
        "title": "Restriction Type",
        "enum": [
          "Blacklist",
          "Whitelist",
          "Unknown"
        ],
        "type": "string",
        "description": "List of available user restriction types."
      }
    },
    "securitySchemes": {
      "X-CM-PRODUCTTOKEN": {
        "type": "apiKey",
        "description": "Your producttoken",
        "name": "X-CM-PRODUCTTOKEN",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "X-CM-PRODUCTTOKEN": []
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 98,
      "1": 254,
      "2": 39,
      "3": 241,
      "4": 128,
      "5": 239,
      "6": 120,
      "7": 0,
      "8": 82,
      "9": 163,
      "10": 4,
      "11": 41
    }
  }
}
```