Documentation

7. Organizations List API Endpoint

Make a GET request to this resource to retrieve the list of organizations.

GET /api/v1/organizations/
HTTP 200 OK
Content-Type: application/json
Vary: Accept
Allow: GET, POST, HEAD, OPTIONS
X-API-Time: 0.055s

The resulting data structure contains:

{
    "count": 99,
    "next": null,
    "previous": null,
    "results": [
        ...
    ]
}

The count field indicates the total number of organizations found for the given query. The next and previous fields provides links to additional results if there are more than will fit on a single page. The results list contains zero or more organization records.

{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 1,
            "type": "organization",
            "url": "/api/v1/organizations/1/",
            "related": {
                "created_by": "/api/v1/users/1/",
                "modified_by": "/api/v1/users/1/",
                "admins": "/api/v1/organizations/1/admins/",
                "users": "/api/v1/organizations/1/users/",
                "inventories": "/api/v1/organizations/1/inventories/",
                "activity_stream": "/api/v1/organizations/1/activity_stream/",
                "projects": "/api/v1/organizations/1/projects/",
                "teams": "/api/v1/organizations/1/teams/"
            },
            "summary_fields": {
                "created_by": {
                    "id": 1,
                    "username": "admin",
                    "first_name": "",
                    "last_name": ""
                },
                "modified_by": {
                    "id": 1,
                    "username": "admin",
                    "first_name": "",
                    "last_name": ""
                }
            },
            "created": "2015-08-25T01:00:18.545Z",
            "modified": "2015-08-25T01:00:18.545Z",
            "name": "Default",
            "description": ""
        }
    ]
}

7.1. Results

Each organization data structure includes the following fields:

  • id: Database ID for this organization. (integer)
  • type: Data type for this organization. (multiple choice)
  • organization: Organization
  • url: URL for this organization. (string)
  • related: Data structure with URLs of related resources. (object)
  • summary_fields: Data structure with name/description for related resources. (object)
  • created: Timestamp when this organization was created. (datetime)
  • modified: Timestamp when this organization was last modified. (datetime)
  • name: (string)
  • description: (string)

7.2. Create Organizations

Make a POST request to this resource with the following organization fields to create a new organization:

  • name: (string, required)
  • description: (string, default=””)

7.3. Reviewing the Options Endpoint

The Options Endpoint table offers a view of the Options for this endpoint. When viewing the endpoint in the browsable API, clicking the “Options” button gives you the raw JSON for the following:

name Organization List
description # List Organizations: Make a GET request to this resource to retrieve the list of organizations.
renders
0 application/json
1 text/html
parses
0 application/json
added_in_version 1.2
actions
POST
name
type string
required
true
label name
max_length 512
description
type string
required
false
label description
default (Empty Text)
GET
id
type integer
label ID
help_text Database ID for this organization.
type
type multiple choice
help_text Data type for this organization.
choices
0
0 organization
1 Organization
url
type string
help_text URL for this organization.
related
type object
help_text Data structure with URLs of related resources.
summary_fields
type object
help_text Data structure with name/description for related resources.
created
type datetime
help_text Timestamp when this organization was created.
modified
type datetime
help_text Timestamp when this organization was last modified.
name
type string
label name
description
type string
label description
types
0 organization
search_fields
0 description
1 name