Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Params

Param name Description
domain
required

Domain

Validations:

  • Must be a String

user_role_id
required

user role ID

Validations:

  • Must be a Integer

Examples

// Not admin user
POST /api/v2/admin/allowed_domains
401
// Successful request
POST /api/v2/admin/allowed_domains
{
  "domain": "example.com",
  "user_role_id": 1
}
200
{
  "allowed_domain": {
    "id": 1,
    "domain": "example.com",
    "created_at": "2023-11-27T09:42:47.735Z",
    "updated_at": "2023-11-27T09:42:47.735Z",
    "user_role_id": 1,
    "user_role": {
      "id": 1,
      "name": "admin",
      "created_at": "2023-11-27T09:42:35.117Z",
      "updated_at": "2023-11-27T09:42:35.289Z",
      "description": "System default"
    }
  }
}
// With invalid parameters
POST /api/v2/admin/allowed_domains
{
  "domain": "examplecom",
  "user_role_id": 1
}
400
{
  "error": "Domain is invalid"
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters