Skip to content

User

Invite users, fetch profiles, enable or disable accounts, and configure prepaid or postpaid billing.

Authentication

All methods require a valid Platform API key in the x-yappes-key header.

Base URL

Substitute the sample host https://platformapi.enterprise-xyz.com with the Platform API URL configured for your Yappes organization, since the host value changes depending on the organization and deployment setup.


REST Resources

Resource Methods
organizations.users get, create, setStatus, setMonetizationConfig

Resource: organizations.users

User lifecycle and monetization configuration within an organization.


Platform API — Fetch User Details

Gets the profile for a user in an organization.

HTTP request

GET https://platformapi.enterprise-xyz.com/v1/organizations/{orgReferenceId}/users/{userReferenceId}

Path parameters

Parameter Type Description
orgReferenceId string Required. Organization reference (organization id, reference name, or organization name). Resolved to an internal organizationId.
userReferenceId string Required. User reference (userId, email, or username).

Query parameters

None.

Request body

The request body must be empty.

Response body

If successful, the response body is:

{
  "userId": "USR-183152C2",
  "email": "info@yappes.com",
  "firstName": "Jane",
  "lastName": "Doe",
  "userName": "janedoe",
  "status": "active",
  "organizationName": "yappes-organization",
  "createdAt": "1717424600000",
  "lastModifiedAt": "1717424600000",
  "apps": ["my-app"],
  "attributes": []
}

Authorization

Requires a valid x-yappes-key header.


Platform API — Enable / Disable User

Enables or disables a user within an organization.

HTTP request

POST https://platformapi.enterprise-xyz.com/v1/organizations/{orgReferenceId}/users/{userReferenceId}?action={action}

Path parameters

Parameter Type Description
orgReferenceId string Required. Organization reference.
userReferenceId string Required. User reference (userId, email, or username).

Query parameters

Parameter Type Description
action string Required. Must be active or inactive. Any other value returns 400.

Request body

The request body must be empty.

Response body

If successful, the server returns 204 No Content with an empty JSON object:

{}

Authorization

Requires a valid x-yappes-key header.


Platform API — Create User

Invites (or re-invites) a user to an organization.

HTTP request

POST https://platformapi.enterprise-xyz.com/v1/organizations/{orgReferenceId}/users

Path parameters

Parameter Type Description
orgReferenceId string Required. Organization reference.

Query parameters

None.

Request body

{
  "email": "jane.doe@example.com",
  "firstName": "Jane",
  "lastName": "Doe",
  "userName": "janedoe",
  "attributes": []
}
Field Type Required Description
email string Yes User email. Also accepted as emailId.
firstName string No First name.
lastName string No Last name.
userName string No Username.
attributes array No Custom attributes.

Response body

If successful (200), the response body contains the invited user profile:

{
  "code": 200,
  "status": "OK",
  "data": {
    "email": "jane.doe@example.com",
    "firstName": "Jane",
    "lastName": "Doe",
    "organizationName": "yappes-organization",
    "status": "active",
    "userId": "USR-XXXXXXXX",
    "createdAt": "1717424600000",
    "modifiedAt": "1717424600000"
  }
}

If the user already exists or the upstream call fails, an ERROR body is returned with the appropriate HTTP status code.

Authorization

Requires a valid x-yappes-key header.


Platform API — Configure Billing Type

Updates a user's monetization configuration (billing type and active state). A switch from postpaid to prepaid is scheduled for the end of the current billing cycle.

HTTP request

PUT https://platformapi.enterprise-xyz.com/v1/organizations/{orgReferenceId}/users/{userReference}/userMonetizationConfig

Path parameters

Parameter Type Description
orgReferenceId string Required. Organization reference.
userReference string Required. User reference (userId, email, or username).

Query parameters

None.

Request body

Prepaid:

{
  "billingType": "PREPAID",
  "state": "ACTIVE"
}

Postpaid:

{
  "billingType": "POSTPAID",
  "state": "ACTIVE"
}
Field Type Required Description
billingType string Yes PREPAID or POSTPAID.
state string Yes ACTIVE or INACTIVE.

Response body

If successful, the response body is:

{
  "code": 200,
  "data": {
    "state": "ACTIVE",
    "billingType": "PREPAID"
  }
}

Authorization

Requires a valid x-yappes-key header.


Method index

# HTTP Path
1 GET /v1/organizations/{orgReferenceId}/users/{userReferenceId}
2 POST /v1/organizations/{orgReferenceId}/users/{userReferenceId}?action={action}
3 POST /v1/organizations/{orgReferenceId}/users
4 PUT /v1/organizations/{orgReferenceId}/users/{userReference}/userMonetizationConfig