Skip to main content
Version: v5.2

Overview of Organization API

This set of API calls allow you to get, create, edit, and delete organizations and return all the users in a particular organization.

The following API calls are available:

Get Organizations for Current User​

Endpoint​

GET /passportsvc/api/v1/organizations

Request​

Parameters​

Query​
ParameterTypeDescriptionRequired
_nameStringFilter by name of the organizationOptional
_userTypeStringFilter by user typeOptional
_shortNameStringFilter by short nameOptional
queryStringWild card search on name, short name and description(For ex: ?query=xyz)Optional
_offsetNumberEnter an offset value for the pagination response.Optional
_pageSizeNumberEnter a number for the ammount of applications you want to return per page.Optional

Response​

Body​

{
"_offset": 0,
"_pageSize": 2,
"_total": 2,
"_list": [
{
"_id": "36a1eb2b-06bd-426e-a3ce-e7ab609ea825",
"_name": "ABC Ltd",
"_description": "ABC Ltd",
"_userType": "external",
"_namespaces": [
"abcl_KQXXC4v5"
],
"_metadata": {
"_createdAt": 1707081965089,
"_updatedAt": 1707084681466,
"_createdById": "3259cd1a-a350-43fb-8447-9c21d2938fb7",
"_updatedById": "3259cd1a-a350-43fb-8447-9c21d2938fb7"
},
"_orgOwner": "251e73a2-1c91-400f-aa6f-8cfab6cc2a79",
"_shortName": "abc_ltd"
},
{
"_id": "325d47a3-0963-40cd-934f-252844e58425",
"_name": "XYZ",
"_description": "",
"_userType": "platform_org",
"_namespaces": [
"xyz_oR3kTC5t"
],
"_metadata": {},
"_orgOwner": "3259cd1a-a350-43fb-8447-9c21d2938fb7",
"_shortName": "platform_org"
}
]
}

Get Organization by ID​

Endpoint​

GET /passportsvc/api/v1/organizations/{id}

Request​

Parameters​

Path​
ParameterTypeDescriptionRequired
idStringThe organization's ID.Required

Response​

Codes​

CodeDescription
200Success
404Not Found

Body​

{
"_id": "325d47a3-0963-40cd-934f-252844e58425",
"_name": "XYZ",
"_description": "",
"_userType": "platform_org",
"_namespaces": [
"xyz_oR3kTC5t"
],
"_metadata": {},
"_orgOwner": "3259cd1a-a350-43fb-8447-9c21d2938fb7",
"_shortName": "platform_org"
}

Create Organization​

Creates an organization with the parameters you pass.

Endpoint​

POST /passportsvc/api/v1/organizations

Authorization​

Platform manager who gets access token from console app can create organization.

Request​

Parameters​

Body​
ParameterTypeDescriptionRequired
_nameNumberPass the organization's name.Required
_orgOwnerStringPass the email address of the user you want to have all permissions for the organization. The org owner can provide access to other users by adding/invite organization owner group.Required
_userTypeStringPass a string that defines the organization's type. Use this label to identify resources of the same type.Optional
_shortNameStringGive the organization a shorter name that will be unique across the platform. If you do not pass a value, _name is the short name by defaultOptional

Code example

{
"_name": "ABC Ltd",
"_orgOwner": "[email protected]",
"_userType":"external"
}

Response​

Body​

{
"_id": "36a1eb2b-06bd-426e-a3ce-e7ab609ea825",
"_name": "ABC Ltd",
"_description": "ABC Ltd",
"_userType": "external",
"_namespaces": [
"abcl_KQXXC4v5"
],
"_metadata": {
"_createdAt": 1707081965089,
"_updatedAt": 1707084681466,
"_createdById": "3259cd1a-a350-43fb-8447-9c21d2938fb7",
"_updatedById": "3259cd1a-a350-43fb-8447-9c21d2938fb7"
},
"_orgOwner": "251e73a2-1c91-400f-aa6f-8cfab6cc2a79",
"_shortName": "abc_ltd"
},

Edit Organization​

Endpoint​

PUT /passportsvc/api/v1/organizations/{id}

Request​

Parameters​

Path​
ParameterTypeDescriptionRequired
idStringThe organization's idRequired
Body​
ParameterTypeDescriptionRequired
_nameNumberPass a new name for the organization.Required
_descriptionNumberPass a new description for the organization.Optional
_userTypeStringPass a new userType, which defines the organizationation's type. Use this label to identify resources of the same type.Optional

Code example

{
"_name": "ABC Ltd",
"_description": "ABC Ltd",
"_userType":"external"
}

Response​

Codes​

CodeDescription
200Success
400Bad Request
404Not Found

Body​

{
"_id": "36a1eb2b-06bd-426e-a3ce-e7ab609ea825",
"_name": "ABC Ltd",
"_description": "ABC Ltd",
"_userType": "external",
"_namespaces": [
"abcl_KQXXC4v5"
],
"_metadata": {
"_createdAt": 1707081965089,
"_updatedAt": 1707084681466,
"_createdById": "3259cd1a-a350-43fb-8447-9c21d2938fb7",
"_updatedById": "3259cd1a-a350-43fb-8447-9c21d2938fb7"
},
"_orgOwner": "251e73a2-1c91-400f-aa6f-8cfab6cc2a79",
"_shortName": "abc_ltd"
},

Delete Organization​

DELETE /passportsvc/api/v1/organizations/{id}

Request​

Parameters​

Path​
ParameterTypeDescriptionRequired
idStringThe organization's idRequired

Response​

Codes​

CodeDescription
204No Content
404Not Found

Get Organization Users​

This API call returns a list of all the users in a specified organization. Organization users are defined as either users in organization-level user groups or users in the user groups of the organization's applications.

The query should apply case insensitive wild card search on first name, last name and email.

Endpoint​

GET /passportsvc/api/v1/organizations/:id/users

Request​

Parameters​

Query​
ParameterTypeDescriptionRequired
queryStringWild card search first name, last name and email (For ex: ?query=john)Optional
_offsetNumberEnter an offset value for the pagination response.Optional
_pageSizeNumberEnter a number for the ammount of applications you want to return per page.Optional

Response​

Body​

{
"_offset": 0,
"_pageSize": 2,
"_total": 2,
"_list": [
{
"_id": "be9ff9f4-ca6a-4c6e-a619-6786862a6b6a",
"_firstname": "john",
"_lastname": "doe",
"_eusa": false,
"_privacy": true,
"_email": "[email protected]",
"_disabled": false
},
{
"_id": "ace9f9c8-6529-4338-9f63-30edf1aeb6bb",
"_firstname": "john",
"_lastname": "doe",
"_eusa": false,
"_privacy": true,
"_email": "[email protected]",
"_disabled": false
}
]
}