Examples

GET /api/roles
200
{
  "total": 13,
  "subtotal": 13,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": "name",
    "order": "ASC"
  },
  "results": [
    {
      "builtin": 0,
      "cloned_from_id": null,
      "name": "Create hosts",
      "id": 9,
      "description": null,
      "origin": ""
    },
    {
      "builtin": 0,
      "cloned_from_id": null,
      "name": "CRUD hosts",
      "id": 12,
      "description": null,
      "origin": ""
    },
    {
      "builtin": 2,
      "cloned_from_id": null,
      "name": "Default role",
      "id": 7,
      "description": null,
      "origin": "foreman"
    },
    {
      "builtin": 0,
      "cloned_from_id": null,
      "name": "Destroy hosts",
      "id": 8,
      "description": null,
      "origin": ""
    },
    {
      "builtin": 0,
      "cloned_from_id": null,
      "name": "Edit hosts",
      "id": 4,
      "description": null,
      "origin": "foreman"
    },
    {
      "builtin": 0,
      "cloned_from_id": null,
      "name": "Edit partition tables",
      "id": 2,
      "description": null,
      "origin": "foreman"
    },
    {
      "builtin": 0,
      "cloned_from_id": null,
      "name": "Manager",
      "id": 1,
      "description": null,
      "origin": "foreman"
    },
    {
      "builtin": 0,
      "cloned_from_id": null,
      "name": "No rights",
      "id": 10,
      "description": null,
      "origin": ""
    },
    {
      "builtin": 0,
      "cloned_from_id": null,
      "name": "Organization admin",
      "id": 13,
      "description": null,
      "origin": "foreman"
    },
    {
      "builtin": 0,
      "cloned_from_id": null,
      "name": "System admin",
      "id": 14,
      "description": null,
      "origin": "foreman"
    },
    {
      "builtin": 0,
      "cloned_from_id": null,
      "name": "View compute resources",
      "id": 11,
      "description": null,
      "origin": ""
    },
    {
      "builtin": 0,
      "cloned_from_id": null,
      "name": "Viewer",
      "id": 5,
      "description": null,
      "origin": "foreman"
    },
    {
      "builtin": 0,
      "cloned_from_id": null,
      "name": "View hosts",
      "id": 3,
      "description": null,
      "origin": "foreman"
    }
  ]
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

search
optional

filter results

Validations:

  • Must be a String

order
optional

Sort and order by a searchable field, e.g. '<field> DESC'

Validations:

  • Must be a String

page
optional

Page number, starting at 1

Validations:

  • Must be a number.

per_page
optional

Number of results per page to return, 'all' to return all results

Validations:

  • Must match regular expression /\A([1-9]\d*|all)\Z$/.

Search fields

Field name Type Possible values
builtin true, false
description text
id integer
name string
permission string