• Document Up to Date

Create Tenant

Creates the given tenant.

Resource Information

This service uses the tomcat application on port 8080 by default. To see a list of default ports click here

The context for this API is /crafter-profile, please prefix the API URLs with this context.

HTTP Verb
POST
URL
/api/1/tenant/create
Response Formats
JSON

Parameters

Name
Type
Required
Description
accessTokenId

String


The access token ID of the application
making the call

Example

Request

POST .../api/1/tenant/create?accessTokenId=e8f5170c-877b-416f-b70f-4b09772f8e2d

 1{
 2    "name" : "sample-tenant",
 3    "verifyNewProfiles" : false,
 4    "availableRoles" : [
 5                      "APP_ADMIN",
 6                      "APP_USER"
 7    ],
 8    "attributeDefinitions" : [
 9        {
10            "name" : "firstName",
11            "metadata" : {
12                "label" : "First Name",
13                "type" : "TEXT",
14                "displayOrder" : 0.0
15            },
16            "permissions" : [
17                {
18                    "application" : "*",
19                    "allowedActions" : [
20                        "*"
21                    ]
22                }
23            ]
24        },
25        {
26            "name" : "lastName",
27            "metadata" : {
28                "label" : "Last Name",
29                "type" : "TEXT",
30                "displayOrder" : 1.0
31            },
32            "permissions" : [
33                {
34                    "application" : "*",
35                    "allowedActions" : [
36                        "*"
37                    ]
38                }
39            ]
40        },
41        {
42            "name" : "avatarLink",
43            "metadata" : {
44                "label" : "Avatar Link",
45                "type" : "TEXT",
46                "displayOrder" : 3.0
47            },
48            "permissions" : [
49                {
50                    "application" : "*",
51                    "allowedActions" : [
52                        "*"
53                    ]
54                }
55            ]
56        }
57    ]
58}

Response

Status 200 OK

 1{
 2      "name": "sample-tenant",
 3      "verifyNewProfiles": false,
 4      "availableRoles": [
 5              "APP_ADMIN",
 6              "APP_USER"
 7      ],
 8      "ssoEnabled": false,
 9      "attributeDefinitions": [
10              {
11                      "permissions": [
12                              {
13                                      "allowedActions": [
14                                              "*"
15                                      ],
16                                      "application": "*"
17                              }
18                      ],
19                      "name": "firstName",
20                      "metadata": {
21                              "label": "First Name",
22                              "type": "TEXT",
23                              "displayOrder": 0.0
24                      },
25                      "defaultValue": null
26              },
27              {
28                      "permissions": [
29                              {
30                                      "allowedActions": [
31                                              "*"
32                                      ],
33                                      "application": "*"
34                              }
35                      ],
36                      "name": "lastName",
37                      "metadata": {
38                              "label": "Last Name",
39                              "type": "TEXT",
40                              "displayOrder": 1.0
41                      },
42                      "defaultValue": null
43              },
44              {
45                      "permissions": [
46                              {
47                                      "allowedActions": [
48                                              "*"
49                                      ],
50                                      "application": "*"
51                              }
52                      ],
53                      "name": "avatarLink",
54                      "metadata": {
55                              "label": "Avatar Link",
56                              "type": "TEXT",
57                              "displayOrder": 3.0
58                      },
59                      "defaultValue": null
60              }
61      ],
62      "id": "5926ee77d4c6ad51e5e44f45"
63}

Responses

Status
Location
Response Body
200

See example above.

400



{"errorCode":"TENANT_EXISTS", "message":"The tenant
\"sample-tenant\" already exists"}
500

{ "message" : "Internal server error" }