# organizations

## GET /organizations/

> List or search all organizations

```json
{"openapi":"3.1.1","info":{"title":"uData API","version":"1.0"},"tags":[{"description":"Organization related operations","name":"organizations"}],"servers":[{"url":"http://www.data.gouv.fr/api/1"}],"paths":{"/organizations/":{"get":{"operationId":"list_organizations","parameters":[{"schema":{"type":"string"},"description":"The search query","in":"query","name":"q"},{"schema":{"type":"string","enum":["name","reuses","datasets","followers","views","created","last_modified","-name","-reuses","-datasets","-followers","-views","-created","-last_modified"]},"description":"The field (and direction) on which sorting apply","in":"query","name":"sort"},{"schema":{"type":"integer","default":1},"description":"The page to display","in":"query","name":"page"},{"schema":{"type":"integer","default":20},"description":"The page size","in":"query","name":"page_size"},{"schema":{"type":"string","enum":["public-service","certified","association","company","local-authority"]},"in":"query","name":"badge"},{"schema":{"type":"string"},"in":"query","name":"name"},{"schema":{"type":"string"},"in":"query","name":"business_number_id"},{"schema":{"type":"string","format":"mask"},"description":"An optional fields mask","in":"header","name":"X-Fields"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationPage"}}}}},"summary":"List or search all organizations","tags":["organizations"]}}},"components":{"schemas":{"OrganizationPage":{"properties":{"data":{"description":"The page data","items":{"$ref":"#/components/schemas/Organization"},"type":"array"},"next_page":{"description":"The next page URL if exists","type":"string"},"page":{"description":"The current page","minimum":1,"type":"integer"},"page_size":{"description":"The page size used for pagination","minimum":0,"type":"integer"},"previous_page":{"description":"The previous page URL if exists","type":"string"},"total":{"description":"The total paginated items","minimum":0,"type":"integer"}},"required":["page","page_size","total"],"type":"object"},"Organization":{"properties":{"acronym":{"description":"The organization acronym","type":"string"},"badges":{"description":"The organization badges","items":{"$ref":"#/components/schemas/Badge (read)"},"readOnly":true,"type":"array"},"business_number_id":{"description":"The organization's business identification number.","type":"string"},"created_at":{"description":"The organization creation date","format":"date-time","readOnly":true,"type":"string"},"deleted":{"description":"The organization deletion date if deleted","format":"date-time","readOnly":true,"type":"string"},"description":{"description":"The organization description in Markdown","format":"markdown","type":"string"},"extras":{"description":"Extras attributes as key-value pairs","type":"object"},"id":{"description":"The organization identifier","readOnly":true,"type":"string"},"last_modified":{"description":"The organization last modification date","format":"date-time","readOnly":true,"type":"string"},"logo":{"description":"The organization logo URL","type":"string"},"logo_thumbnail":{"description":"The organization logo thumbnail URL. This is the square (100x100) and cropped version.","type":"string"},"members":{"items":{"allOf":[{"$ref":"#/components/schemas/Member"}],"description":"The organization members"},"type":"array"},"metrics":{"description":"The organization metrics","readOnly":true,"type":"object"},"name":{"description":"The organization name","type":"string"},"page":{"description":"The organization web page URL","readOnly":true,"type":"string"},"permissions":{"allOf":[{"$ref":"#/components/schemas/OrganizationPermissions"}],"readOnly":true},"slug":{"description":"The organization string used as permalink","readOnly":true,"type":"string"},"uri":{"description":"The API URI for this organization","readOnly":true,"type":"string"},"url":{"description":"The organization website URL","type":"string"}},"required":["description","name"],"type":"object"},"Badge (read)":{"properties":{"kind":{"type":"string"}},"required":["kind"],"type":"object"},"Member":{"properties":{"label":{"readOnly":true,"type":"string"},"role":{"default":"editor","description":"The member role in the organization","enum":["admin","editor","partial_editor"],"type":"string"},"since":{"description":"The date the user joined the organization","format":"date-time","readOnly":true,"type":"string"},"user":{"$ref":"#/components/schemas/MemberUserWithEmail"}},"required":["role"],"type":"object"},"MemberUserWithEmail":{"allOf":[{"$ref":"#/components/schemas/UserReference"},{"properties":{"email":{"description":"The user email (only present on show organization endpoint if the current user is member of the organization: admin or editor)","readOnly":true,"type":"object"},"last_login_at":{"description":"The user last connection date (only present on show organization endpoint if the current user is member of the organization: admin or editor)","readOnly":true,"type":"object"}},"type":"object"}]},"UserReference":{"allOf":[{"$ref":"#/components/schemas/BaseReference"},{"properties":{"avatar":{"description":"The user avatar URL","type":"string"},"avatar_thumbnail":{"description":"The user avatar thumbnail URL. This is the square (500x500) and cropped version.","type":"string"},"first_name":{"description":"The user first name","readOnly":true,"type":"string"},"last_name":{"description":"The user larst name","readOnly":true,"type":"string"},"page":{"description":"The user web page URL","readOnly":true,"type":"string"},"slug":{"description":"The user permalink string","readOnly":true,"type":"string"},"uri":{"description":"The API URI for this user","readOnly":true,"type":"string"}},"type":"object"}]},"BaseReference":{"discriminator":"class","properties":{"class":{"description":"The object class","type":"string"},"id":{"description":"The object unique identifier","type":"string"}},"required":["class","id"],"type":"object"},"OrganizationPermissions":{"properties":{"delete":{"type":"boolean"},"edit":{"type":"boolean"},"harvest":{"type":"boolean"},"members":{"type":"boolean"},"private":{"type":"boolean"}},"type":"object"}}}}
```

{% openapi src="<https://www.data.gouv.fr/api/1/swagger.json>" path="/organizations/" method="post" %}
<https://www.data.gouv.fr/api/1/swagger.json>
{% endopenapi %}

{% openapi src="<https://www.data.gouv.fr/api/1/swagger.json>" path="/organizations/badges/" method="get" %}
<https://www.data.gouv.fr/api/1/swagger.json>
{% endopenapi %}

{% openapi src="<https://www.data.gouv.fr/api/1/swagger.json>" path="/organizations/roles/" method="get" %}
<https://www.data.gouv.fr/api/1/swagger.json>
{% endopenapi %}

{% openapi src="<https://www.data.gouv.fr/api/1/swagger.json>" path="/organizations/suggest/" method="get" %}
<https://www.data.gouv.fr/api/1/swagger.json>
{% endopenapi %}

{% openapi src="<https://www.data.gouv.fr/api/1/swagger.json>" path="/organizations/{id}/followers/" method="get" %}
<https://www.data.gouv.fr/api/1/swagger.json>
{% endopenapi %}

{% openapi src="<https://www.data.gouv.fr/api/1/swagger.json>" path="/organizations/{id}/followers/" method="post" %}
<https://www.data.gouv.fr/api/1/swagger.json>
{% endopenapi %}

{% openapi src="<https://www.data.gouv.fr/api/1/swagger.json>" path="/organizations/{id}/followers/" method="delete" %}
<https://www.data.gouv.fr/api/1/swagger.json>
{% endopenapi %}

{% openapi src="<https://www.data.gouv.fr/api/1/swagger.json>" path="/organizations/{org}/" method="get" %}
<https://www.data.gouv.fr/api/1/swagger.json>
{% endopenapi %}

{% openapi src="<https://www.data.gouv.fr/api/1/swagger.json>" path="/organizations/{org}/" method="put" %}
<https://www.data.gouv.fr/api/1/swagger.json>
{% endopenapi %}

{% openapi src="<https://www.data.gouv.fr/api/1/swagger.json>" path="/organizations/{org}/" method="delete" %}
<https://www.data.gouv.fr/api/1/swagger.json>
{% endopenapi %}

{% openapi src="<https://www.data.gouv.fr/api/1/swagger.json>" path="/organizations/{org}/badges/" method="post" %}
<https://www.data.gouv.fr/api/1/swagger.json>
{% endopenapi %}

{% openapi src="<https://www.data.gouv.fr/api/1/swagger.json>" path="/organizations/{org}/badges/{badge\_kind}/" method="delete" %}
<https://www.data.gouv.fr/api/1/swagger.json>
{% endopenapi %}

{% openapi src="<https://www.data.gouv.fr/api/1/swagger.json>" path="/organizations/{org}/catalog" method="get" %}
<https://www.data.gouv.fr/api/1/swagger.json>
{% endopenapi %}

{% openapi src="<https://www.data.gouv.fr/api/1/swagger.json>" path="/organizations/{org}/catalog.{format}" method="get" %}
<https://www.data.gouv.fr/api/1/swagger.json>
{% endopenapi %}

{% openapi src="<https://www.data.gouv.fr/api/1/swagger.json>" path="/organizations/{org}/datasets/" method="get" %}
<https://www.data.gouv.fr/api/1/swagger.json>
{% endopenapi %}

{% openapi src="<https://www.data.gouv.fr/api/1/swagger.json>" path="/organizations/{org}/discussions/" method="get" %}
<https://www.data.gouv.fr/api/1/swagger.json>
{% endopenapi %}

{% openapi src="<https://www.data.gouv.fr/api/1/swagger.json>" path="/organizations/{org}/membership/" method="get" %}
<https://www.data.gouv.fr/api/1/swagger.json>
{% endopenapi %}

## GET /organizations/{org}/assignments/

> List assignments for this organization

```json
{"openapi":"3.1.1","info":{"title":"uData API","version":"1.0"},"tags":[{"description":"Organization related operations","name":"organizations"}],"servers":[{"url":"http://www.data.gouv.fr/api/1"}],"paths":{"/organizations/{org}/assignments/":{"get":{"operationId":"list_organization_assignments","parameters":[{"schema":{"type":"string","format":"mask"},"description":"An optional fields mask","in":"header","name":"X-Fields"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Assignment%20%28read%29"},"type":"array"}}}}},"summary":"List assignments for this organization","tags":["organizations"]}}},"components":{"schemas":{}}}
```

## DELETE /organizations/{org}/member/{user}/

> Delete member from an organization

```json
{"openapi":"3.1.1","info":{"title":"uData API","version":"1.0"},"tags":[{"description":"Organization related operations","name":"organizations"}],"servers":[{"url":"http://www.data.gouv.fr/api/1"}],"paths":{"/organizations/{org}/member/{user}/":{"delete":{"operationId":"delete_organization_member","responses":{"403":{"description":"Not Authorized"}},"summary":"Delete member from an organization","tags":["organizations"]}}}}
```

## Sync assignments for a partial\_editor member

> Replaces all current assignments with the provided list.

```json
{"openapi":"3.1.1","info":{"title":"uData API","version":"1.0"},"tags":[{"description":"Organization related operations","name":"organizations"}],"servers":[{"url":"http://www.data.gouv.fr/api/1"}],"paths":{"/organizations/{org}/member/{user}/assignments/":{"put":{"description":"Replaces all current assignments with the provided list.","operationId":"sync_member_assignments","parameters":[{"schema":{"type":"string","format":"mask"},"description":"An optional fields mask","in":"header","name":"X-Fields"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Assignment%20%28read%29"},"type":"array"}}}},"403":{"description":"Not Authorized"}},"summary":"Sync assignments for a partial_editor member","tags":["organizations"]}}},"components":{"schemas":{}}}
```

## PUT /organizations/{org}/member/{user}/

> Update member status into a given organization

```json
{"openapi":"3.1.1","info":{"title":"uData API","version":"1.0"},"tags":[{"description":"Organization related operations","name":"organizations"}],"servers":[{"url":"http://www.data.gouv.fr/api/1"}],"paths":{"/organizations/{org}/member/{user}/":{"put":{"operationId":"update_organization_member","parameters":[{"schema":{"type":"string","format":"mask"},"description":"An optional fields mask","in":"header","name":"X-Fields"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}}},"403":{"description":"Not Authorized"}},"summary":"Update member status into a given organization","tags":["organizations"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}},"required":true}}}},"components":{"schemas":{"Member":{"properties":{"label":{"readOnly":true,"type":"string"},"role":{"default":"editor","description":"The member role in the organization","enum":["admin","editor","partial_editor"],"type":"string"},"since":{"description":"The date the user joined the organization","format":"date-time","readOnly":true,"type":"string"},"user":{"$ref":"#/components/schemas/MemberUserWithEmail"}},"required":["role"],"type":"object"},"MemberUserWithEmail":{"allOf":[{"$ref":"#/components/schemas/UserReference"},{"properties":{"email":{"description":"The user email (only present on show organization endpoint if the current user is member of the organization: admin or editor)","readOnly":true,"type":"object"},"last_login_at":{"description":"The user last connection date (only present on show organization endpoint if the current user is member of the organization: admin or editor)","readOnly":true,"type":"object"}},"type":"object"}]},"UserReference":{"allOf":[{"$ref":"#/components/schemas/BaseReference"},{"properties":{"avatar":{"description":"The user avatar URL","type":"string"},"avatar_thumbnail":{"description":"The user avatar thumbnail URL. This is the square (500x500) and cropped version.","type":"string"},"first_name":{"description":"The user first name","readOnly":true,"type":"string"},"last_name":{"description":"The user larst name","readOnly":true,"type":"string"},"page":{"description":"The user web page URL","readOnly":true,"type":"string"},"slug":{"description":"The user permalink string","readOnly":true,"type":"string"},"uri":{"description":"The API URI for this user","readOnly":true,"type":"string"}},"type":"object"}]},"BaseReference":{"discriminator":"class","properties":{"class":{"description":"The object class","type":"string"},"id":{"description":"The object unique identifier","type":"string"}},"required":["class","id"],"type":"object"}}}}
```

## POST /organizations/{org}/member/

> Invite a user or email to join the organization

```json
{"openapi":"3.1.1","info":{"title":"uData API","version":"1.0"},"tags":[{"description":"Organization related operations","name":"organizations"}],"servers":[{"url":"http://www.data.gouv.fr/api/1"}],"paths":{"/organizations/{org}/member/":{"post":{"operationId":"invite_organization_member","parameters":[{"schema":{"type":"string","format":"mask"},"description":"An optional fields mask","in":"header","name":"X-Fields"}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipRequest"}}}},"400":{"description":"Bad Request"},"403":{"description":"Not Authorized"}},"summary":"Invite a user or email to join the organization","tags":["organizations"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipInvite"}}},"required":true}}}},"components":{"schemas":{"MembershipRequest":{"properties":{"assignments":{"description":"Objects to assign on acceptance (for partial_editor invitations)","items":{"$ref":"#/components/schemas/GenericReference"},"type":"array"},"comment":{"description":"A request comment from the user","type":"string"},"created":{"description":"The request creation date","format":"date-time","readOnly":true,"type":"string"},"email":{"description":"Email for non-registered user invitations","type":"string"},"id":{"readOnly":true,"type":"string"},"kind":{"default":"request","description":"The request kind (request or invitation)","enum":["request","invitation"],"type":"string"},"role":{"default":"editor","description":"The role to assign","enum":["admin","editor","partial_editor"],"type":"string"},"status":{"description":"The current request status","enum":["pending","accepted","refused","canceled"],"type":"string"},"user":{"$ref":"#/components/schemas/MemberUserWithEmail"}},"required":["status"],"type":"object"},"GenericReference":{"properties":{"class":{"type":"string"},"id":{"type":"string"}},"type":"object"},"MemberUserWithEmail":{"allOf":[{"$ref":"#/components/schemas/UserReference"},{"properties":{"email":{"description":"The user email (only present on show organization endpoint if the current user is member of the organization: admin or editor)","readOnly":true,"type":"object"},"last_login_at":{"description":"The user last connection date (only present on show organization endpoint if the current user is member of the organization: admin or editor)","readOnly":true,"type":"object"}},"type":"object"}]},"UserReference":{"allOf":[{"$ref":"#/components/schemas/BaseReference"},{"properties":{"avatar":{"description":"The user avatar URL","type":"string"},"avatar_thumbnail":{"description":"The user avatar thumbnail URL. This is the square (500x500) and cropped version.","type":"string"},"first_name":{"description":"The user first name","readOnly":true,"type":"string"},"last_name":{"description":"The user larst name","readOnly":true,"type":"string"},"page":{"description":"The user web page URL","readOnly":true,"type":"string"},"slug":{"description":"The user permalink string","readOnly":true,"type":"string"},"uri":{"description":"The API URI for this user","readOnly":true,"type":"string"}},"type":"object"}]},"BaseReference":{"discriminator":"class","properties":{"class":{"description":"The object class","type":"string"},"id":{"description":"The object unique identifier","type":"string"}},"required":["class","id"],"type":"object"},"MembershipInvite":{"properties":{"assignments":{"description":"Objects to assign on acceptance (for partial_editor invitations)","items":{"$ref":"#/components/schemas/GenericReference"},"type":"array"},"comment":{"description":"Invitation message","type":"string"},"email":{"description":"Email to invite (if user not registered)","type":"string"},"role":{"default":"editor","description":"The role to assign","enum":["admin","editor","partial_editor"],"type":"string"},"user":{"description":"User ID to invite","type":"string"}},"type":"object"}}}}
```

{% openapi src="<https://www.data.gouv.fr/api/1/swagger.json>" path="/organizations/{org}/membership/" method="post" %}
<https://www.data.gouv.fr/api/1/swagger.json>
{% endopenapi %}

{% openapi src="<https://www.data.gouv.fr/api/1/swagger.json>" path="/organizations/{org}/membership/{id}/accept/" method="post" %}
<https://www.data.gouv.fr/api/1/swagger.json>
{% endopenapi %}

{% openapi src="<https://www.data.gouv.fr/api/1/swagger.json>" path="/organizations/{org}/membership/{id}/refuse/" method="post" %}
<https://www.data.gouv.fr/api/1/swagger.json>
{% endopenapi %}

{% openapi src="<https://www.data.gouv.fr/api/1/swagger.json>" path="/organizations/{org}/reuses/" method="get" %}
<https://www.data.gouv.fr/api/1/swagger.json>
{% endopenapi %}
