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 eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ..." \
      --data 
        '{
            "id": "b568feca-f8ad-11ed-be56-0242ac120002", 
            "name": "Example Organization & Co.",
            "admin_user": "7bb660df-6ef7-4654-cd38-89583f2f5bca",
            "currency_code": "EUR"
        }'


Example Response

{
    "id": "8e7e77ff-9116-4abd-b246-f3b0fd0323dd",
    "name": "Example Organization & Co.",
    "admin_user": "7bb660df-6ef7-4654-ab38-89583f2f5cwq"
}

Create Organization with Invitation

Attribute Type Required Description
name str yes name of the organization
admin_user_invitation object yes user details
email 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 eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ..." \
      --data
        '{
            "name": "Example Organization & Co.",
            "admin_user_invitation":
                {
                    "email": "[email protected]",
                    "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-9dbs-4df9-97fd-9f18eb058b8b",
            "updated": "2023-05-23T08:23:29.706107Z",
            "email": "[email protected]",
            "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 GET "https://account.ezeep.com/partner/v1/organizations/" \
      --header "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ..."


Example Response

{
    "count": 3,
    "next": null,
    "previous": null,
    "results":
    [
        {
            "id": "bd6c2d6f-7785-4ea2-b33d-9b42aab1bebf",
            "name": "Example Organization & Co.",
            "azure_profile": null
        },
        .
        .
    ]
}

Get an Organization

curl GET "https://account.ezeep.com/partner/v1/organizations/{organizationid}"

Attribute Type Required Description
id str yes uuid of the organization in the URI


Example Request

curl  -L GET "https://account.ezeep.com/partner/v1/organizations/bd6c2d6f-7785-4ea2-b33d-9b42aab1bebf" \
      --header "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ..."


Example Response

{
    "id": "bd6c2d6f-7785-4ea2-b33d-9b42aab1bebf",
    "name": "Example Organization & Co.",
    "azure_profile": null
}

Patch an Organization

curl PATCH "https://account.ezeep.com/partner/v1/organizations/{organizationid}"

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 eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ..." \
      --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.

curl -X DELETE "https://account.ezeep.com/partner/v1/organizations/{organizationid}"

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 eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ..."


Example Response

code 204