Edit this page on GitHub

Home > docs > api > Organization

Organization

An Organization owns projects, repositories, inventories, secrets and teams.

The REST API provides support for working with organizations:

Create an Organization

Creates a new organization with specified parameters.

Only administrators can create new organizations.

  • URI /api/v1/org
  • Method POST
  • Headers Authorization, Content-Type: application/json
  • Body
      {
        "name": "myOrg"
      }
    
  • Success response

      Content-Type: application/json
    
      {
        "result": "CREATED",
        "ok": true,
        "id": "..."
      }
    

Update an Organization

Updates parameters of an existing organization.

  • URI /api/v1/org
  • Method POST
  • Headers Authorization, Content-Type: application/json
  • Body
      {
        "name": "new name",
        "id": "---"
      }
    

    Organization id is mandatory, in case of updating organization name.

  • Success response

      Content-Type: application/json
    
      {
        "result": "UPDATED",
        "ok": true,
        "id": "..."
      }
    

List Organizations

Lists all available organizations.

  • URI /api/v1/org?onlyCurrent=${onlyCurrent}
  • Method GET
  • Headers Authorization
  • Parameters If the ${onlyCurrent} parameter is true, then the server will return the list of the current user’s organizations. Otherwise, all organizations will be returned.
  • Body none
  • Success response

      Content-Type: application/json
    
      [
        {
          "id": "...",
          "name": "..."
        },
        {
          "id": "...",
          "name": "..."
         }
      ]