Skip to main content

Assignment to organizations

Use the following endpoints to manage the assignment of root assemblies to sub-organizations:

Creating assignments of assemblies to sub-organizations

POST /1/catalog/assignments/organizations

Multiple assemblies can be assigned to organizations in one call by specifying a list of assignments. Assignments are defined as pairs of assembly id and organization id.

The endpoint returns a list of indices of assignments, which have been created. The result contains also an error dictionary in case some assignments could not be created with corresponding error descriptions. Assignments that already exist will be ignored.

note

Only root assemblies can be assigned to sub-organizations.

Assemblies are always part of the main-organization. This means that explicit assignments of assemblies to the root-organization will fail.

note

This endpoint will respond with error code 503 when the catalog API is in maintenance mode.

Each assignment in the list contains:

ParameterValue
ass_idUnique id of the assembly to be assigned to an sub-organization
org_idUnique id of the sub-organization to which the assembly should be assigned

🡢 See API Reference


> POST https://api.partium.io/1/catalog/assignments/organizations
> Authorization: Bearer <<Your Access Token or API Key>>
> Content-Type: application/json
>
> [
> {
> "ass_id": "root-ass1",
> "org_id": "sub-org1"
> },
> {
> "ass_id": "root-ass1",
> "org_id": "sub-org2"
> },
> {
> "ass_id": "root-ass2",
> "org_id": "sub-org2"
> }
> ]
>
< HTTP/1.1 200 OK
< Content-Type: application/json
<
< {
< "created": [0,1,2],
< "errors": {}
< }
note

Replace <<Your Access Token or API Key>> with the preferred authentication method. See Authentication.


Removing assignments of assemblies to sub-organizations

DELETE /1/catalog/assignments/organizations

Multiple assemblies can be removed from sub-organizations in one call by specifying a list of assignments. Assignments are defined as pairs of assembly id and organization id.

The endpoint does not return information about deleted entities. Assignments that do not exist will be silently ignored.

Each entry in the list of assignments to remove contains:

ParameterValue
ass_idUnique id of the assembly to be removed from an sub-organization
org_idUnique id of the sub-organization from which the assembly should be removed
note

This endpoint will respond with error code 503 when the catalog API is in maintenance mode.

🡢 See API Reference


> DELETE https://api.partium.io/1/catalog/assignments/organizations
> Authorization: Bearer <<Your Access Token or API Key>>
> Content-Type: application/json
>
> [
> {
> "ass_id": "root-ass1",
> "org_id": "sub-org1"
> },
> {
> "ass_id": "root-ass2",
> "org_id": "sub-org1"
> }
> ]
>
< HTTP/1.1 200 OK
< Content-Type: application/json
<
< {}
note

Replace <<Your Access Token or API Key>> with the preferred authentication method. See Authentication.


Listing assignments of assemblies to sub-organizations

POST /1/catalog/assignments/organizations/list

Query a list of assignments of assemblies to sub-organizations. The list can be filtered by specifying a list of ass_ids and a list of org_ids. A paging mechanism can be used to fetch more data if the number of results exceeds the paging limit.

ParameterValue
query.ass_idsOptional list of assembly ids. If specified, only assignments of the specified assemblies are part of the result
query.org_idsOptional list of organization ids. If specified, only assignments to the specified sub-organizations are included in the result
paging.limitMaximum number of results returned by the endpoint
paging.last_object_idUse this id to get the next page of results. The id is returned by a previous call to this endpoint

🡢 See API Reference

note

Assemblies are always part of the main organization. Therefore, the result does not contain explicit assignments to the main organization.

Only root assemblies can be assigned to sub-organizations. Sub-assemblies are then automatically part of the sub-organizations too. This means that the resulting list of assignments will not contain any sub-assemblies.


> POST https://api.partium.io/1/catalog/assignments/organizations/list
> Authorization: Bearer <<Your Access Token or API Key>>
> Content-Type: application/json
>
> {
> "query": {
> "ass_ids": ["root-ass1", "root-ass2"]
> },
> "paging": {
> "limit": 10
> }
> }
>
< HTTP/1.1 200 OK
< Content-Type: application/json
<
< {
< "result": [
< {
< "ass_id": "root-ass1"
< "org_id": "sub-org1",
< },
< {
< "ass_id": "root-ass1"
< "org_id": "sub-org2",
< },
< {
< "ass_id": "root-ass2"
< "org_id": "sub-org2",
< }
< ],
< "last_object_id": "unique_object_id",
< "more_data": false
< }
note

Replace <<Your Access Token or API Key>> with the preferred authentication method. See Authentication.

more_data in the response is true indicates that there are more results to fetch. In that case use the returned last_object_id as a parameter for the next call to fetch the next page of results. Repeat this until more_data is false.