{
  "openapi" : "3.1.0",
  "info" : {
    "title" : "ABAC Policies REST API",
    "description" : "API for managing ABAC Policies",
    "version" : "v1"
  },
  "servers" : [ {
    "url" : "https://apis.objectsgrid.com"
  } ],
  "paths" : {
    "/abacpolicies/{id}" : {
      "get" : {
        "summary" : "Retrieve ABAC Policy",
        "operationId" : "retrieveABACPolicy",
        "security" : [ {
          "accessTokenAuth" : [ ]
        } ],
        "parameters" : [ {
          "name" : "id",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "string"
          },
          "description" : "ID of the ABAC Policy to retrieve. \nPresently there is only one per organization account, and its format is abac-policy--'orgAcctID', where orgAcctId is your Organization Account ID\n"
        }, {
          "in" : "header",
          "name" : "X-ObjectsGrid-AccessPoint",
          "description" : "EU or US depending on where your Organization Account is located",
          "schema" : {
            "type" : "string",
            "enum" : [ "EU", "US" ]
          },
          "required" : true
        }, {
          "in" : "header",
          "name" : "X-ObjectsGrid-RestApiVersion",
          "description" : "This header allows targeting an API version.\nIf you want to target the latest API version set its value to 'latest'\nIf you want to target the latest stable API version set its value to 'stable'\n",
          "schema" : {
            "type" : "string"
          },
          "required" : false
        }, {
          "in" : "header",
          "name" : "X-ObjectsGrid-SessionID",
          "description" : "This header allows you to provide a Session ID to be traced through the request stack and returned in the response.\n",
          "schema" : {
            "type" : "string"
          },
          "required" : false
        } ],
        "responses" : {
          "200" : {
            "description" : "Successfully retrieved the ABAC Policy",
            "headers" : {
              "X-ObjectsGrid-CorrelationID" : {
                "$ref" : "#/components/headers/X-ObjectsGrid-CorrelationID"
              },
              "X-ObjectsGrid-SessionID" : {
                "$ref" : "#/components/headers/X-ObjectsGrid-SessionID"
              },
              "ETag" : {
                "description" : "The object version. Send it in the If-Match header to update, patch or delete this exact version",
                "schema" : {
                  "type" : "string"
                }
              }
            },
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "https://objectsgrid.com/.well-known/objects-catalog/ABACPolicy/v1/schema.json"
                }
              }
            }
          },
          "400" : {
            "description" : "Bad request",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "401" : {
            "description" : "Unauthorized",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "404" : {
            "description" : "Not Found",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "429" : {
            "description" : "Too Many Requests",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "500" : {
            "description" : "Internal server error",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          }
        }
      },
      "put" : {
        "summary" : "Update ABAC Policy",
        "operationId" : "updateABACPolicy",
        "security" : [ {
          "accessTokenAuth" : [ ]
        } ],
        "parameters" : [ {
          "name" : "id",
          "in" : "path",
          "required" : true,
          "schema" : {
            "type" : "string"
          },
          "description" : "ID of the ABAC Policy to retrieve. \nPresently there is only one per organization account, and its format is abac-policy--'orgAcctID', where orgAcctId is your Organization Account ID.\n\nThis id must match the id in the request body.\n"
        }, {
          "in" : "header",
          "name" : "X-ObjectsGrid-AccessPoint",
          "description" : "EU or US depending on where your Organization Account is located",
          "schema" : {
            "type" : "string",
            "enum" : [ "EU", "US" ]
          },
          "required" : true
        }, {
          "in" : "header",
          "name" : "If-Match",
          "description" : "The ETag of the object version being modified, as returned by the Retrieve, Create, Update or Patch operations.\nIf the object has been modified since that version, the request fails with 412 Precondition Failed.\n",
          "schema" : {
            "type" : "string"
          },
          "required" : false
        }, {
          "in" : "header",
          "name" : "X-ObjectsGrid-RestApiVersion",
          "description" : "This header allows targeting an API version.\nIf you want to target the latest API version set its value to 'latest'\nIf you want to target the latest stable API version set its value to 'stable'\n",
          "schema" : {
            "type" : "string"
          },
          "required" : false
        }, {
          "in" : "header",
          "name" : "X-ObjectsGrid-SessionID",
          "description" : "This header allows you to provide a Session ID to be traced through the request stack and returned in the response.\n",
          "schema" : {
            "type" : "string"
          },
          "required" : false
        } ],
        "requestBody" : {
          "required" : true,
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "https://objectsgrid.com/.well-known/objects-catalog/ABACPolicy/v1/schema.json"
              }
            }
          }
        },
        "responses" : {
          "200" : {
            "description" : "Successfully updated the ABAC Policy",
            "headers" : {
              "X-ObjectsGrid-CorrelationID" : {
                "$ref" : "#/components/headers/X-ObjectsGrid-CorrelationID"
              },
              "X-ObjectsGrid-SessionID" : {
                "$ref" : "#/components/headers/X-ObjectsGrid-SessionID"
              },
              "ETag" : {
                "description" : "The object version. Send it in the If-Match header to update, patch or delete this exact version",
                "schema" : {
                  "type" : "string"
                }
              }
            },
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "https://objectsgrid.com/.well-known/objects-catalog/ABACPolicy/v1/schema.json"
                }
              }
            }
          },
          "400" : {
            "description" : "Bad request",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "401" : {
            "description" : "Unauthorized",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "404" : {
            "description" : "Not Found",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "412" : {
            "description" : "Precondition Failed - the object was modified since the version in the If-Match header",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "429" : {
            "description" : "Too Many Requests",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          },
          "500" : {
            "description" : "Internal server error",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "https://objectsgrid.com/.well-known/objects-catalog/ErrorResponse/v1/schema.json"
                }
              }
            }
          }
        }
      }
    }
  },
  "components" : {
    "headers" : {
      "X-ObjectsGrid-CorrelationID" : {
        "description" : "The Correlation ID is a unique value generated by ObjectsGrid and used for troubleshooting issues",
        "schema" : {
          "type" : "string"
        }
      },
      "X-ObjectsGrid-SessionID" : {
        "description" : "If your request contained this header, it will be included in the response",
        "schema" : {
          "type" : "string"
        }
      }
    },
    "securitySchemes" : {
      "accessTokenAuth" : {
        "type" : "http",
        "scheme" : "bearer",
        "bearerFormat" : "Bearer JWT",
        "description" : "An ObjectsGrid access token (a JWT), sent as 'Authorization: Bearer <token>': from POST /oauth2/token, valid 1 hour, or an API key: a service account's from the bootstrap of an Organization Account created without signing in, valid 90 days; a public service account's (POST /serviceaccounts/{id}/apikey, or the bootstrap's anonymous one), without expiry, until its account is disabled or deleted."
      }
    }
  }
}