- Create an Organization
- Get all Organizations
- Get an Organization
- Patch an Organization
- Delete an Organization
Organization
An organization represents a collection of users and User Invitation.
Create an Organization
There are two different schemes to create an organization. Create Organization with User is used to create an organization and at the same time set an existing user from another organization as admin. Create Organization with Invitation is used to create an organization and at the same time create a user as an admin, which in turn also triggers an invitation email.
Create Organization with User
POST "https://account.ezeep.com/partner/v1/organizations/"
| Attribute | Type | Required | Description |
|---|---|---|---|
| name | str | yes | name of the organization |
| admin_user | str | yes | uuid of the existing user |
| currency_code | str | yes | ENUM [ USD, EUR ] |
Example Request
curl -L -X POST "https://account.ezeep.com/partner/v1/organizations/" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <access_token>" \
--data '{
"id": "b568feca-f8ad-11ed-be56-0242ac120002",
"name": "Example Organization & Co.",
"admin_user": "7bb660df-6ef7-4654-cd38-89583f2f5bca",
"currency_code": "EUR"
}'
Example Response
{
"id": "b568feca-f8ad-11ed-be56-0242ac120002",
"name": "Example Organization & Co.",
"admin_user": "7bb660df-6ef7-4654-cd38-89583f2f5bca"
}
Create Organization with Invitation
POST "https://account.ezeep.com/partner/v1/organizations/"
| Attribute | Type | Required | Description |
|---|---|---|---|
| name | str | yes | name of the organization |
| admin_user_invitation | object | yes | user details |
| str | yes | user’s email | |
| expire_date | str (date-time) | yes | invitation duration |
| user | object | yes | user details |
| first_name | str | yes | user’s first name |
| last_name | str | yes | user’s last name |
| preferred_language | str | yes | ENUM [ en, de ] |
| currency_code | str | yes | ENUM [ USD, EUR ] |
Example Request
curl -L -X POST "https://account.ezeep.com/partner/v1/organizations/" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <access_token>" \
--data '{
"name": "Example Organization & Co.",
"admin_user_invitation":
{
"email": "johndoe@example.com",
"expire_date": "2023-05-24T13:45:47.216Z",
"user":
{
"first_name": "john",
"last_name": "doe",
"preferred_language": "en"
}
},
"currency_code": "EUR"
}'
Example Response
{
"id": "bd6c8f6d-2285-4ea6-b44d-9b42aab0bcde",
"name": "Example Organization & Co.",
"admin_user_invitation":
{
"id": "6da870ca-9db5-4df9-97fd-9f18eb058b8b",
"updated": "2023-05-23T08:23:29.706107Z",
"email": "johndoe@example.com",
"expire_date": "2023-05-24T13:45:47.216000Z",
"delivery_status": "SENT",
"invitation_status": "OPEN",
"user":
{
"id": "94668332-54c5-4e92-be57-55134922994f",
"first_name": "john",
"last_name": "doe",
"preferred_language": "en"
}
}
}
Get all Organizations
GET "https://account.ezeep.com/partner/v1/organizations/"
Example Request
curl -L -X GET "https://account.ezeep.com/partner/v1/organizations/" \
--header "Authorization: Bearer <access_token>"
Example Response
{
"count": 1,
"next": null,
"previous": null,
"results":
[
{
"id": "bd6c2d6f-7785-4ea2-b33d-9b42aab1bebf",
"name": "Example Organization & Co.",
"azure_profile": null
}
]
}
Get an Organization
GET "https://account.ezeep.com/partner/v1/organizations/<organization_id>/"
| Attribute | Type | Required | Description |
|---|---|---|---|
| id | str | yes | uuid of the organization in the URI |
Example Request
curl -L -X GET "https://account.ezeep.com/partner/v1/organizations/bd6c2d6f-7785-4ea2-b33d-9b42aab1bebf/" \
--header "Authorization: Bearer <access_token>"
Example Response
{
"id": "bd6c2d6f-7785-4ea2-b33d-9b42aab1bebf",
"name": "Example Organization & Co.",
"azure_profile": null
}
Patch an Organization
PATCH "https://account.ezeep.com/partner/v1/organizations/<organization_id>/"
| Attribute | Type | Required | Description |
|---|---|---|---|
| id | str | yes | uuid of the organization in the URI |
| name | str | yes | new name |
Example Request
curl --request PATCH "https://account.ezeep.com/partner/v1/organizations/bd6c2d6f-7785-4ea2-b33d-9b42aab1bebf/" \
--header "Authorization: Bearer <access_token>" \
--header 'Content-Type: application/json' \
--data '{
"name": "John Doe & Co."
}'
Example Response
{
"id": "bd6c2d6f-7785-4ea2-b33d-9b42aab1bebf",
"name": "John Doe & Co.",
"azure_profile": null
}
Delete an Organization
Note that deleting the organization will permanently delete all users and invitations, as well as all other related objects from other APIs, if no relationship to other organizations exists.
DELETE "https://account.ezeep.com/partner/v1/organizations/<organization_id>/"
| Attribute | Type | Required | Description |
|---|---|---|---|
| id | str | yes | uuid of the organization in the URI |
Example Request
curl --request DELETE "https://account.ezeep.com/partner/v1/organizations/bd6c2d6f-7785-4ea2-b33d-9b42aab1bebf/" \
--header "Authorization: Bearer <access_token>"
Example Response
code 204