Header name | Description |
---|---|
Content-Type required |
application/json |
X-API-KEY required |
YOUR_API_KEY |
// Successful request GET /api/v2/admin/allowed_domains 200 { "allowed_domains": [] }
// Not admin user GET /api/v2/admin/allowed_domains 401
Code | Description |
---|---|
401 | Unauthorized |
404 | Not found |
500 | Internal Server Error |
422 | Missing parameters |
Header name | Description |
---|---|
Content-Type required |
application/json |
X-API-KEY required |
YOUR_API_KEY |
Param name | Description |
---|---|
domain required |
Domain Validations:
|
user_role_id required |
user role ID Validations:
|
// 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" }
Code | Description |
---|---|
401 | Unauthorized |
404 | Not found |
500 | Internal Server Error |
422 | Missing parameters |
Header name | Description |
---|---|
Content-Type required |
application/json |
X-API-KEY required |
YOUR_API_KEY |
Param name | Description |
---|---|
domain required |
Domain Validations:
|
user_role_id required |
user role ID Validations:
|
// Not admin user POST /api/v2/admin/allowed_domains/:allowed_domain_id 401
// Allowed domain not found POST /api/v2/admin/allowed_domains/:allowed_domain_id { "domain": "new-example.com", "user_role_id": 2 } 404 { "error": "Couldn't find AllowedDomain with 'id'=:allowed_domain_id" }
// Successful request POST /api/v2/admin/allowed_domains/2 { "domain": "new-example.com", "user_role_id": 2 } 200 { "allowed_domain": { "domain": "new-example.com", "user_role_id": 2, "id": 2, "created_at": "2023-11-27T09:42:48.159Z", "updated_at": "2023-11-27T09:42:48.253Z", "user_role": { "id": 2, "name": "default", "created_at": "2023-11-27T09:42:35.293Z", "updated_at": "2023-11-27T09:42:35.425Z", "description": "System default" } } }
Code | Description |
---|---|
401 | Unauthorized |
404 | Not found |
500 | Internal Server Error |
422 | Missing parameters |
Header name | Description |
---|---|
Content-Type required |
application/json |
X-API-KEY required |
YOUR_API_KEY |
// Not admin user DELETE /api/v2/admin/allowed_domains/:allowed_domain_id 401
// Allowed domain not found DELETE /api/v2/admin/allowed_domains/:allowed_domain_id 404 { "error": "Couldn't find AllowedDomain with 'id'=:allowed_domain_id" }
// Successful request DELETE /api/v2/admin/allowed_domains/3 200 { "ok": "allowed domain removed successfully" }
Code | Description |
---|---|
401 | Unauthorized |
404 | Not found |
500 | Internal Server Error |
422 | Missing parameters |