Skip to Content
APIsUsers

Architectural Alias: The endpoints in this file are simplified shortcuts for the unified Resource Memberships API. They provide a domain-specific view for managing users and organisation members without any data duplication.

Access: Admin+ roles within the organisation. See access-control.md.

Endpoints for managing users and their memberships within an organisation.

Required Headers:

partner-api-key: <YOUR_PLATFORM_API_KEY> Authorization: Bearer <USER_JWT_TOKEN> Content-Type: application/json

Member Management Summary

EndpointMethodOperation NameDescription
/usersGETList MembersGet all members of the organisation
/users/\{user_uuid\}GETView MemberGet specific member’s details
/users/\{user_uuid\}/rolePUTUpdate RoleUpdate a member’s role (Admin/Member)
/users/\{user_uuid\}DELETEDelete User From OrgEnd a user’s membership (status to REMOVED)
/users/invitationsPOSTInvite MemberInvite a new user to the organisation
/users/invitations/bulkPOSTBulk InviteInvite multiple users in one request
/users/invitationsGETList InvitationsView all pending/accepted invitations for this org
/users/invitations/acceptPOSTProcess InviteAccept or decline an organisation invitation
/users/\{user_uuid\}/pilot-credsPOSTCreate CredentialsAdd pilot credentials for a user
/users/\{user_uuid\}/pilot-credsGETGet CredentialsRetrieve all pilot credentials for a user

1. Member Management

GET /users

Get all members of the organisation.

Query Parameters:

ParamTypeDescription
statusintFilter by user status enum
roleintFilter by org_membership_role

Responses:

  • 200 OK:
{ "data": [ { "user_uuid": "...", "user_udai_id": "...", "first_name": "John", "last_name": "Smith", "membership": { "membership_uuid": "...", "role": 1, "status": 1 } } ], "pagination": { "total_records": 105, "current_page": 1, "per_page": 25 } }

GET /users/{user_uuid}

Get a specific member’s profile and pilot credentials.

Responses:

  • 200 OK:
{ "data": { "user_uuid": "660e8400-e29b-41d4-a716-446655440000", "user_udai_id": "UDAI-USR-0001", "email": "john@example.com", "first_name": "John", "last_name": "Smith", "phone": "+919876543210", "profile_picture": null, "email_verified": true, "phone_verified": false, "is_certified_pilot": true, "status": 1, "created_at": "2025-01-01T00:00:00Z", "updated_at": "2025-01-15T10:30:00Z", "pilot_credentials": [ { "cred_uuid": "550e8400-e29b-41d4-a716-446655440000", "cred_udai_id": null, "rpc_number": "RPC123456789", "category": 1, "sub_category": 1, "class": 1, "status": 1 } ], "org_memberships": [ { "membership_uuid": "...", "membership_status": 1, "role": 2, "org_uuid": "...", "org_udai_id": "UDAI-ORG-0001", "org_name": "Example Org", "org_type": 1, "org_status": 1 } ] } }

Note: pilot_credentials is an array since a user can have multiple credentials for different asset categories.

PUT /users/{user_uuid}/role

Update a member’s role (1=Member, 2=Admin, 3=Owner). Only Owners can promote to Admin.

Request Body:

{ "role": 2 }

DELETE /users/{user_uuid}

Remove a member from the organisation.

  • Side-effect: Updates the unified Resource Memberships status to REMOVED (-2).

Responses:

  • 200 OK:
{ "message": "Status updated to REMOVED (-2)" }

2. Org Invitations & Shortcut Routes

The following routes are simplified shortcuts to the unified Resource Memberships API.

POST /users/invitations

Invite a new user to the organisation via email or phone.

  • Reference: POST /resource-invitations (with resource_type=1)

POST /users/invitations/bulk

Invite multiple users simultaneously to join the organisation.

Request Body:

{ "invitations": [ { "invite_identifier": "user1@example.com", "invite_mode": 1, "invite_role": 3 }, { "invite_identifier": "+919876543210", "invite_mode": 2, "invite_role": 3 } ] }
  • Reference: Multiple calls to POST /resource-invitations

GET /users/invitations

List all pending or past invitations for users to join this organisation.

  • Reference: GET /resource-invitations?resource_type=1&resource_uuid=\{org_uuid\}&invitee_type=1

POST /users/invitations/accept

Accept or decline a pending organisation invitation.

  • Reference: POST /resource-invitations/accept

3. Pilot Credentials Management

Endpoints for managing pilot credentials for users. A user can have multiple pilot credentials for different asset categories, subcategories, and classes.

POST /users/{user_uuid}/pilot-creds

Create pilot credentials for a user. This endpoint allows adding credentials for certified pilots.

Request Body:

{ "rpc_number": "RPC123456789", "category": 1, "sub_category": 1, "class": 1 }

Field Descriptions:

FieldTypeRequiredDescription
rpc_numberstringYesRemote Pilot Certificate number
categoryintYesAsset category (1=Nano, 2=Micro, 3=Small, 4=Medium, 5=Large)
sub_categoryintYesAsset subcategory enum value
classintYesAsset class enum value

Responses:

  • 201 Created:
{ "message": "Pilot credentials created successfully", "data": { "cred_uuid": "550e8400-e29b-41d4-a716-446655440000", "user_uuid": "660e8400-e29b-41d4-a716-446655440000", "rpc_number": "RPC123456789", "category": 1, "sub_category": 1, "class": 1, "status": 1, "created_at": "2025-01-15T10:30:00Z", "updated_at": "2025-01-15T10:30:00Z" } }
  • 400 Bad Request: Validation errors
  • 404 Not Found: User not found
  • 409 Conflict: Pilot credentials already exist for this user
  • 500 Internal Server Error: Server error

GET /users/{user_uuid}/pilot-creds

Retrieve all pilot credentials for a specific user. Returns an array of credentials since a user can have multiple credentials.

Responses:

  • 200 OK:
{ "data": [ { "cred_uuid": "550e8400-e29b-41d4-a716-446655440000", "user_uuid": "660e8400-e29b-41d4-a716-446655440000", "rpc_number": "RPC123456789", "category": 1, "sub_category": 1, "class": 1, "status": 1, "created_at": "2025-01-15T10:30:00Z", "updated_at": "2025-01-15T10:30:00Z" }, { "cred_uuid": "770e8400-e29b-41d4-a716-446655440000", "user_uuid": "660e8400-e29b-41d4-a716-446655440000", "rpc_number": "RPC123456789", "category": 2, "sub_category": 2, "class": 2, "status": 1, "created_at": "2025-01-20T14:20:00Z", "updated_at": "2025-01-20T14:20:00Z" } ] }
  • 404 Not Found: User not found or no pilot credentials exist
  • 500 Internal Server Error: Server error

Note: The pilot_credentials field in the user object (returned by GET /users/\{user_uuid\}) also returns an array of credentials with the same structure.

Last updated on