User Management API (v2)

Download OpenAPI specification:Download

Users

APIs to onboard and manage users.

Create user

This endpoint is used to create user profiles in Spotnana. This is typically used by partner companies to onboard user profiles of their customer organizations.

SecurityBearer
Request
Request Body schema: application/json
required
object (UserPersonalInfo)

User details.

object (BusinessInfo)

User business information.

persona
required
string (Persona)

Persona of the user

Enum: "UNKNOWN_PERSONA" "EMPLOYEE" "GUEST" "PERSONAL" "RELATIVE" "ADHOC"
isActive
boolean

a boolean flag to show if traveler is active.

object (RelativeOf)

Link to primary traveler

billingCurrency
string

Preferred billing currency of the user

tier
string (Tier)

Tier of User

Enum: "BASIC" "SEAT1A"
externalId
string

External id of this user.

object (TravelPreferences)

User's travel preferences

object (MembershipInfo)

User's travel preferences

object (NotificationPreferences)

Notification preferences of a user for different notification types.

object (UserTravelArrangers)
Deprecated

Travel arrangers for a user.

object (AdhocUserInfo)

Basic information related to ad-hoc traveler profile.

Array of objects (RoleConfig)
Responses
201

Created

401

Unauthorized

403

Forbidden

post/v2/users
Request samples
application/json
{
  • "personalInfo": {
    },
  • "businessInfo": {
    },
  • "persona": "EMPLOYEE",
  • "isActive": true,
  • "relativeOf": {
    },
  • "billingCurrency": "INR",
  • "tier": "SEAT1A",
  • "externalId": "string",
  • "travelPreferences": {
    },
  • "membershipInfo": {
    },
  • "notificationPreferences": {
    },
  • "travelArrangers": {
    },
  • "adhocUserInfo": {
    },
  • "roles": [
    ]
}
Response samples
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}

Query user

This endpoint queries user of given company based on given identifier like email or external ID. In case includeInactive is true, inactive users are also included in the response.

SecurityBearer
Request
query Parameters
companyId
required
string <uuid>

Identifier for company.

Example: companyId=4974a66b-7493-4f41-908c-58ba81093947
email
string <email>

Email of the user. One of email or externalId should be provided.

Example: email=user@example.com
externalId
string

External id of the user. Only one of email or externalId should be provided.

Example: externalId=123456
includeInactive
boolean
Default: false

If true, include inactive users in the response.

Example: includeInactive=true
Responses
200

OK

401

Unauthorized

403

Forbidden

get/v2/users
Request samples
Response samples
application/json
{
  • "length": 0,
  • "elements": [
    ]
}

Get user

This endpoint gets user details for user ID.

SecurityBearer
Request
path Parameters
userId
required
string <uuid>

Identifier for user.

Example: 4974a66b-7493-4f41-908c-58ba81093947
query Parameters
includeInactive
boolean
Default: false

Include inactive users in the response.

Example: includeInactive=true
Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

get/v2/users/{userId}
Request samples
Response samples
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "personalInfo": {
    },
  • "businessInfo": {
    },
  • "persona": "EMPLOYEE",
  • "isActive": true,
  • "tier": "SEAT1A",
  • "relativeOf": {
    },
  • "travelPreferences": {
    },
  • "membershipInfo": {
    },
  • "notificationPreferences": {
    },
  • "travelArrangers": {
    },
  • "adhocUserInfo": {
    },
  • "externalId": "string"
}

Delete user

This endpoint deletes a user by user ID.

SecurityBearer
Request
path Parameters
userId
required
string <uuid>

Identifier for user.

Example: 4974a66b-7493-4f41-908c-58ba81093947
Responses
204

No Content

401

Unauthorized

403

Forbidden

delete/v2/users/{userId}
Request samples
Response samples
application/json
{
  • "debugIdentifier": "string",
  • "errorMessages": [
    ]
}

Update user

SecurityBearer
Request
path Parameters
userId
required
string <uuid>

Identifier for user.

Example: 4974a66b-7493-4f41-908c-58ba81093947
Request Body schema: application/json
required
object (UserPersonalInfo)

User details.

required
object (BusinessInfo)

User business information.

persona
required
string (Persona)

Persona of the user

Enum: "UNKNOWN_PERSONA" "EMPLOYEE" "GUEST" "PERSONAL" "RELATIVE" "ADHOC"
tier
string (Tier)

Tier of User

Enum: "BASIC" "SEAT1A"
object (RelativeOf)

Link to primary traveler

object (TravelPreferences)

User's travel preferences

object (MembershipInfo)

User's travel preferences

object (NotificationPreferences)

Notification preferences of a user for different notification types.

object (AdhocUserInfo)

Basic information related to ad-hoc traveler profile.

externalId
string

External id of this user.

object (UserTravelArrangers)
Deprecated

Travel arrangers for a user.

Responses
200

No Content

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

put/v2/users/{userId}
Request samples
application/json
{
  • "personalInfo": {
    },
  • "businessInfo": {
    },
  • "persona": "EMPLOYEE",
  • "tier": "SEAT1A",
  • "relativeOf": {
    },
  • "travelPreferences": {
    },
  • "membershipInfo": {
    },
  • "notificationPreferences": {
    },
  • "adhocUserInfo": {
    },
  • "externalId": "string",
  • "travelArrangers": {
    }
}
Response samples
application/json
{
  • "debugIdentifier": "string",
  • "errorMessages": [
    ]
}

Get user business info

This endpoint gets user business info by user ID.

SecurityBearer
Request
path Parameters
userId
required
string <uuid>

Identifier for user.

Example: 4974a66b-7493-4f41-908c-58ba81093947
query Parameters
includeInactive
boolean
Default: false

Include inactive users.

Example: includeInactive=true
Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

get/v2/users/{userId}/business-info
Request samples
Response samples
application/json
{
  • "departmentRef": {
    },
  • "designation": "MANAGER",
  • "email": "user@business.com",
  • "employeeId": "101",
  • "gradeRef": {
    },
  • "legalEntityRef": {
    },
  • "managerRef": {
    },
  • "officeRef": {
    },
  • "organizationRef": {
    },
  • "phoneNumbers": [
    ],
  • "costCenterRef": {
    },
  • "countryCode": "USA",
  • "workerType": "EMPLOYEE",
  • "accountingCode": "123",
  • "companySpecifiedAttributes": [
    ],
  • "designatedApproverRefs": [
    ],
  • "authorizerEmail": "example@email.com"
}

Update user business info

This endpoint updates user business info by user ID.

SecurityBearer
Request
path Parameters
userId
required
string <uuid>

Identifier for user.

Example: 4974a66b-7493-4f41-908c-58ba81093947
query Parameters
includeInactive
boolean
Default: false

Include inactive users.

Example: includeInactive=true
Request Body schema: application/json
object (Reference)

Reference of an entity

designation
string
email
string <email>
employeeId
string

Unique employee id. Can use email if a company don't use employee ids.

object (Reference)

Reference of an entity

required
object (Reference)

Reference of an entity

object (Reference)

Reference of an entity

object (Reference)

Reference of an entity

required
object (Reference)

Reference of an entity

Array of objects (PhoneNumber)
object (Reference)

Reference of an entity

countryCode
string

alpha-2 or alpha-3 ISO country code.

workerType
string (WorkerType)

The type of worker.

Enum: "EMPLOYEE" "CONTINGENT" "SEASONAL" "INTERN"
accountingCode
string

Code used for accounting.

Array of objects (CompanySpecifiedAttribute)
Array of objects (Reference object containing uuid and name of the entity.)

A list of references for designated approvers.

authorizerEmail
string
Deprecated

Email address to be used as approval authorizer, when a manager is not present.

Responses
204

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

put/v2/users/{userId}/business-info
Request samples
application/json
{
  • "departmentRef": {
    },
  • "designation": "MANAGER",
  • "email": "user@business.com",
  • "employeeId": "101",
  • "gradeRef": {
    },
  • "legalEntityRef": {
    },
  • "managerRef": {
    },
  • "officeRef": {
    },
  • "organizationRef": {
    },
  • "phoneNumbers": [
    ],
  • "costCenterRef": {
    },
  • "countryCode": "USA",
  • "workerType": "EMPLOYEE",
  • "accountingCode": "123",
  • "companySpecifiedAttributes": [
    ],
  • "designatedApproverRefs": [
    ],
  • "authorizerEmail": "example@email.com"
}
Response samples
application/json
{
  • "debugIdentifier": "string",
  • "errorMessages": [
    ]
}

Get user personal info

This endpoint gets user personal info by user ID.

SecurityBearer
Request
path Parameters
userId
required
string <uuid>

Identifier for user.

Example: 4974a66b-7493-4f41-908c-58ba81093947
query Parameters
includeInactive
boolean
Default: false

Include inactive users.

Example: includeInactive=true
Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

get/v2/users/{userId}/personal-info
Request samples
Response samples
application/json
{
  • "addresses": [
    ],
  • "dob": {
    },
  • "email": "example@email.com",
  • "emergencyContactInfo": {
    },
  • "gender": "FEMALE",
  • "identityDocs": [
    ],
  • "name": {
    },
  • "phoneNumbers": [
    ],
  • "profilePicture": {},
  • "nationality": "Indian",
  • "title": "MR",
  • "preferredLanguage": "en-US",
  • "preferredPronoun": "SHE_HER_HERS",
  • "travelerName": {
    }
}

Update user personal info

This endpoint updates user personal info by user ID.

SecurityBearer
Request
path Parameters
userId
required
string <uuid>

Identifier for user.

Example: 4974a66b-7493-4f41-908c-58ba81093947
query Parameters
includeInactive
boolean
Default: false

Include inactive users.

Example: includeInactive=true
Request Body schema: application/json
Array of objects (PostalAddress)
object (DateModel)

Date in ISO 8601 standard.

email
string <email>
object (EmergencyContactInfo)

Emergency contact information.

gender
string (Gender)
Enum: "MALE" "FEMALE" "UNSPECIFIED" "UNDISCLOSED"
Array of PassportWrapper (object) or ImmigrationDocumentWrapper (object) or RedressNumberWrapper (object) or KnownTravelerNumberWrapper (object) or NationalDocWrapper (object) (IdentityDocument)

List of user identity documents.

object (Name)

Full name containing first, middle, last (family) names, and suffix.

Array of objects (PhoneNumber)
object (Image)

An image with meta data. Either the data or url property must be supplied to load the image.

nationality
string

Nationality of user

title
string (UserTitle)
Enum: "TITLE_UNKNOWN" "MR" "MS" "MRS" "MX" "MASTER" "MISS" "DR" "PROFESSOR" "CAPTAIN" "REVEREND" "HONOURABLE" "SIR" "LADY" "AMBASSADOR" "LORD" "BRIGADIER" "SENATOR" "DAME" "JUSTICE" "UK"
preferredLanguage
string

Language preferred by user.

preferredPronoun
string (PreferredPronoun)

Pronoun preferred by user.

Enum: "SHE_HER_HERS" "HE_HIM_HIS" "THEY_THEM_THEIRS"
object (Name)

A name of user that does not contain special characters.

Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

put/v2/users/{userId}/personal-info
Request samples
application/json
{
  • "addresses": [
    ],
  • "dob": {
    },
  • "email": "example@email.com",
  • "emergencyContactInfo": {
    },
  • "gender": "FEMALE",
  • "identityDocs": [
    ],
  • "name": {
    },
  • "phoneNumbers": [
    ],
  • "profilePicture": {},
  • "nationality": "Indian",
  • "title": "MR",
  • "preferredLanguage": "en-US",
  • "preferredPronoun": "SHE_HER_HERS",
  • "travelerName": {
    }
}
Response samples
application/json
{
  • "debugIdentifier": "string",
  • "errorMessages": [
    ]
}

Get user travel preferences

SecurityBearer
Request
path Parameters
userId
required
string <uuid>

Identifier for user.

Example: 4974a66b-7493-4f41-908c-58ba81093947
Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

get/v2/users/{userId}/travel-preferences
Request samples
Response samples
application/json
{
  • "preferences": {
    }
}

Update user travel preferences

SecurityBearer
Request
path Parameters
userId
required
string <uuid>

Identifier for user.

Example: 4974a66b-7493-4f41-908c-58ba81093947
Request Body schema: application/json
object (TravelPref)

Travel preferences.

Responses
204

No Content

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

put/v2/users/{userId}/travel-preferences
Request samples
application/json
{
  • "preferences": {
    }
}
Response samples
application/json
{
  • "debugIdentifier": "string",
  • "errorMessages": [
    ]
}

Get user membership info

SecurityBearer
Request
path Parameters
userId
required
string <uuid>

Identifier for user.

Example: 4974a66b-7493-4f41-908c-58ba81093947
Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

get/v2/users/{userId}/membership-info
Request samples
Response samples
application/json
{
  • "membershipInfos": [
    ]
}

Update user membership info

SecurityBearer
Request
path Parameters
userId
required
string <uuid>

Identifier for user.

Example: 4974a66b-7493-4f41-908c-58ba81093947
Request Body schema: application/json
Array of objects (LoyaltyInfo)
Responses
204

No Content

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

put/v2/users/{userId}/membership-info
Request samples
application/json
{
  • "membershipInfos": [
    ]
}
Response samples
application/json
{
  • "debugIdentifier": "string",
  • "errorMessages": [
    ]
}

Update user roles

This endpoint updates user roles.

SecurityBearer
Request
path Parameters
userId
required
string <uuid>

Identifier for user.

Example: 4974a66b-7493-4f41-908c-58ba81093947
Request Body schema: application/json
Array of objects (RoleConfig)
Responses
204

No Content

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

put/v2/users/{userId}/roles
Request samples
application/json
{
  • "roles": [
    ]
}
Response samples
application/json
{
  • "debugIdentifier": "string",
  • "errorMessages": [
    ]
}

Get user roles

This endpoint gets user roles.

SecurityBearer
Request
path Parameters
userId
required
string <uuid>

Identifier for user.

Example: 4974a66b-7493-4f41-908c-58ba81093947
Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

get/v2/users/{userId}/roles
Request samples
Response samples
application/json
{
  • "roles": [
    ]
}

Get notification preferences

This endpoint gets notification preferences for a user.

SecurityBearer
Request
path Parameters
userId
required
string <uuid>

Identifier for user.

Example: 4974a66b-7493-4f41-908c-58ba81093947
Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

get/v2/users/{userId}/notification-preferences
Request samples
Response samples
application/json
{
  • "preferences": [
    ]
}

Update notification preferences

This endpoint updates notification preferences for a user.

SecurityBearer
Request
path Parameters
userId
required
string <uuid>

Identifier for user.

Example: 4974a66b-7493-4f41-908c-58ba81093947
Request Body schema: application/json
Array of objects (NotificationPreferencePerType)
Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

put/v2/users/{userId}/notification-preferences
Request samples
application/json
{
  • "preferences": [
    ]
}
Response samples
application/json
{
  • "debugIdentifier": "string",
  • "errorMessages": [
    ]
}

Get user travel arrangers

SecurityBearer
Request
path Parameters
userId
required
string <uuid>

Identifier for user.

Example: 4974a66b-7493-4f41-908c-58ba81093947
Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

get/v2/users/{userId}/travel-arrangers
Request samples
Response samples
application/json
{
  • "travelArrangers": [
    ]
}

Get user's external ID

This endpoint gets user's external ID by user ID.

SecurityBearer
Request
path Parameters
userId
required
string <uuid>

Identifier for user.

Example: 4974a66b-7493-4f41-908c-58ba81093947
query Parameters
includeInactive
boolean
Default: false

Include inactive users.

Example: includeInactive=true
Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

get/v2/users/{userId}/external-id
Request samples
Response samples
application/json
{
  • "externalId": "user-1"
}

Update user's external ID

This endpoint updates user's external ID by user ID.

SecurityBearer
Request
path Parameters
userId
required
string <uuid>

Identifier for user.

Example: 4974a66b-7493-4f41-908c-58ba81093947
query Parameters
includeInactive
boolean
Default: false

Include inactive users.

Example: includeInactive=true
Request Body schema: application/json
externalId
required
string

External id of user within partner database.

Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

put/v2/users/{userId}/external-id
Request samples
application/json
{
  • "externalId": "user-1"
}
Response samples
application/json
{
  • "debugIdentifier": "string",
  • "errorMessages": [
    ]
}

Activate a user

This endpoint activates a deactivated user.

SecurityBearer
Request
path Parameters
userId
required
string <uuid>

Identifier for user.

Example: 4974a66b-7493-4f41-908c-58ba81093947
Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

post/v2/users/{userId}/activate
Request samples
Response samples
application/json
{
  • "debugIdentifier": "string",
  • "errorMessages": [
    ]
}

Get user policies

SecurityBearer
Request
path Parameters
userId
required
string <uuid>

Identifier for user.

Example: 4974a66b-7493-4f41-908c-58ba81093947
Responses
200

OK

401

Unauthorized

403

Forbidden

404

The specified resource was not found.

get/v2/users/{userId}/applicable-policies
Request samples
Response samples
application/json
{
  • "policies": [
    ]
}
Copyright © 2020-2024 Spotnana Technology, Inc.