Organization management

Create an organization

POST /api/v2/organizations
Authorization: Bearer ZW1haWxAZXhhbXBsZS5jb206cGFzc3dvcmQ=
Content-Type: application/json
Accept: application/json

{
    "organizationName": "Mulberry and Sons"
}
Property Type Required Description
organizationName string yes The name of the organization.

The response is a 200 OK status code:

200
{
    "organizationId": "aaa888222aaa3330000ffff"
}
Property Description
organizationId The ID associated to the new organization.

Create and authenticate a user (SSO)

POST /api/v2/organizations/:org_id/access-url
Authorization: Bearer ZW1haWxAZXhhbXBsZS5jb206cGFzc3dvcmQ=
Content-Type: application/json
Accept: application/json

{
    "email": "tom@example.com",
    "filters": [{
         "datasetId": "1234123412341234",
         "permanentFilters": [{
            "field": "city",
            "value": "Montreal"
         }],
         "temporaryFilters": [{
             "field": "rating",
             "value": 5
         }]
     }, {
         "datasetId": "78907890800987987",
         "permanentFilters": [{
            "field": "country",
            "value": "Morocco"
        }]
    }, {
         "datasetId": "63636363636336363"
    }]
}
Property Type Required Description
email string yes A user's email address. An account is created if there's no account associated to it.
filters array yes An array of filter parameters. See table below.
noRestriction boolean yes Set to true if the user has access to everything. Defaults to false.

filters and noRestriction are mutually exclusive, but at least one must be used. An empty filters array means that the users doesn't have access to anything, while setting noRestriction to true gives them full access.

Property Type Required Description
datasetId string yes An existing, valid dataset ID.
permanentFilters array no An array of filters (a field and a value) that can't be removed.
temporaryFilters array no An array of filters (a field and a value) that can be removed.

The user will only have access to the datasets mentioned in filters, therefore a dataset should be mentioned even if no filters are applied (see the last array element in the example above). If you create a new dataset and want the user to have access to it, you'll have to authenticate them again.

Important: If the same dataset is there more than once in the filters array, only the last configuration will be taken into account. As such, you should only give one configuration per dataset to avoid bad surprises.

200
{
    "path": "/partner-login?token=akdAKDYHlkh18384jh1mkj&version=2",
    "defaultOrigin": "https://app.keatext.ai"
}
Property Description
path The path to authenticate the user. Must be prefixed with a hostname.
defaultOrigin The hostname to use if no custom domain is used.

The path returned is relative and must be prefixed with a hostname. If a partner uses a custom domain with a CNAME record pointing to the Keatext servers, the full path can be reconstructed as:

          Domain name
        ---------------
https://partnername.com/partner-login?token=akdAKDYHlkh18384jh1mkj&version=2
-----                  -----------------------------------------------------
Protocol must          The value of the path property
be HTTPS

The URL lets the user log into the application and is only valid for 30 seconds. Once they are logged in, their session will stay active for up to 7 days, after which you will have to authenticate them again.

Delete a user

A user can be deleted permanently to prevent them from accessing data before their token expires.

DELETE /api/v2/organizations/:org_id/users?email=tom@example.com
Authorization: Bearer ZW1haWxAZXhhbXBsZS5jb206cGFzc3dvcmQ=

The response is a 204 No Content status code if the user was deleted successfully.

results matching ""

    No results matching ""