# Organization

## List organizations

> Retrieves a list of all organizations. Each organization includes a \`name\`, an optional \`parent\` identifying its parent organization (forming a hierarchy), and a \`description\`. Returns \*\*200 OK\*\* with a list of organizations in the response body.

```json
{"openapi":"3.0.1","info":{"title":"GBDS API","version":"5.1.16"},"servers":[{"url":"http://<ip>:8085/gbds/v2"}],"paths":{"/organizations":{"get":{"tags":["organization"],"operationId":"list_3","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListOrganizationsResponse"}}}}},"description":"Retrieves a list of all organizations. Each organization includes a `name`, an optional `parent` identifying its parent organization (forming a hierarchy), and a `description`. Returns **200 OK** with a list of organizations in the response body.","parameters":[],"summary":"List organizations"}}},"components":{"schemas":{"ListOrganizationsResponse":{"type":"object","properties":{"httpResponse":{"$ref":"#/components/schemas/HttpResponse"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Organization"}}}},"HttpResponse":{"type":"object","properties":{"httpCode":{"type":"integer","format":"int32"},"body":{"type":"string"}}},"Organization":{"type":"object","properties":{"parent":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}}}}}}
```

## Create or update organizations

> Creates a new organization or updates an existing one. The request body includes the organization's \`name\`, optional \`description\`, and optional \`parent\` indicating the parent organization. A successful creation returns \*\*201 Created\*\*, while updating an existing organization returns \*\*202 Accepted\*\*.

```json
{"openapi":"3.0.1","info":{"title":"GBDS API","version":"5.1.16"},"servers":[{"url":"http://<ip>:8085/gbds/v2"}],"paths":{"/organizations":{"post":{"tags":["organization"],"operationId":"save","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}},"required":true},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"202":{"description":"Accepted","content":{"application/json":{"schema":{"type":"object"}}}}},"description":"Creates a new organization or updates an existing one. The request body includes the organization's `name`, optional `description`, and optional `parent` indicating the parent organization. A successful creation returns **201 Created**, while updating an existing organization returns **202 Accepted**.","parameters":[],"summary":"Create or update organizations"}}},"components":{"schemas":{"Organization":{"type":"object","properties":{"parent":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}}}}}}
```

## Get organization

> Retrieves a single organization by its \`name\`. The \`name\` path parameter uniquely identifies the organization. The response includes the organization's \`name\`, optional \`parent\`, and \`description\` fields and returns \*\*200 OK\*\* when found.

```json
{"openapi":"3.0.1","info":{"title":"GBDS API","version":"5.1.16"},"servers":[{"url":"http://<ip>:8085/gbds/v2"}],"paths":{"/organizations/{name}":{"get":{"tags":["organization"],"operationId":"get_6","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationResponse"}}}}},"description":"Retrieves a single organization by its `name`. The `name` path parameter uniquely identifies the organization. The response includes the organization's `name`, optional `parent`, and `description` fields and returns **200 OK** when found.","summary":"Get organization"}}},"components":{"schemas":{"OrganizationResponse":{"type":"object","properties":{"httpResponse":{"$ref":"#/components/schemas/HttpResponse"},"data":{"$ref":"#/components/schemas/Organization"}}},"HttpResponse":{"type":"object","properties":{"httpCode":{"type":"integer","format":"int32"},"body":{"type":"string"}}},"Organization":{"type":"object","properties":{"parent":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}}}}}}
```

## Delete organization

> Deletes an organization identified by the \`name\` path parameter. On successful deletion, returns \*\*204 No Content\*\*.

```json
{"openapi":"3.0.1","info":{"title":"GBDS API","version":"5.1.16"},"servers":[{"url":"http://<ip>:8085/gbds/v2"}],"paths":{"/organizations/{name}":{"delete":{"tags":["organization"],"operationId":"delete_2","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"NO CONTENT (deleted)","content":{"application/json":{"schema":{"type":"object"}}}}},"description":"Deletes an organization identified by the `name` path parameter. On successful deletion, returns **204 No Content**.","summary":"Delete organization"}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.griaule.com/apis/gbds-5/organization.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
