Skip to content

Tenancy API

The Tenancy API manages who owns what on PlayTelly. Its main resources are organizations, the users and roles inside them, workspaces, teams and integration profiles. This page covers the domain as a whole and the general settings of a workspace's ticketing site; each resource has its own page.

Resources

Resource What it is Reference
Organization The top-level tenant. Holds users, roles, workspaces, teams and app access. Created by PlayTelly staff or by self-signup. Organizations
Workspace A sub-unit of an organization with its own members, apps, spaces and channels. Workspaces
Team A group of organization users that holds one role on a workspace as a unit. Teams
Integration profile Stored email, payment or POS provider credentials of an organization. Integration profiles
General settings Site logo, contact details, legal pages and integration settings of a workspace's ticketing site (this page). Below

Authentication and permissions

Every route except the public ones sends Authorization: Bearer <ACCESS_TOKEN>. Get a token from the Authentication API. See Authentication. A token belongs to exactly one organization, so a request for another organization's ID returns 403.

Permissions for the general settings routes on this page:

Action Permission
Read the legal content pages and the site logo Public
Read or change general settings, legal pages or integration settings workspace:general-settings:manage on the workspace in the path

The permissions of the other resources are on their pages.

Base path

Served by CoreAPI. There are two path families:

https://<API_HOST>/api/v1/tenancy/organizations/{orgId}/…
https://<API_HOST>/api/settings/{workspaceId}/…
  • {orgId} is the organization ID. It must match the organization in your token.
  • {workspaceId} is the workspace ID. It must belong to the organization in your token.
  • The public reads of the legal pages and the logo have no workspace in the path (/api/settings/privacyPolicy). They return the content of the one workspace that backs the customer ticketing site.

Capabilities

  • Organizations: create, list, approve, disable, reject, delete, self-signup. See Organizations.
  • Users, invitations, roles and app access of an organization
  • Workspaces: create, update, delete, members, app access, spaces, channels. See Workspaces.
  • Teams and team roles on workspaces. See Teams.
  • Email, payment and POS integration profiles. See Integration profiles.
  • General settings of a workspace: contact email, time zone, site logo
  • Legal content pages in English, Malay and Chinese: privacy policy, terms of purchase, terms of service, FAQ, contact us, refund policy
  • Integration settings of the ticketing site: POS, payment gateway and email sender
  • Webhook configuration (planned)

Object model

General settings

One settings record exists per workspace. It is created with empty values the first time it is read or written.

Field Type Description
generalId integer Record ID. Read-only.
contactEmail string (email, max 255) Support contact shown to customers.
timeZone string (max 255) IANA time zone name, for example Asia/Kuala_Lumpur.
attachmentName, contentType string File name and media type of the site logo. Read-only. Change the logo by uploading with PUT .../general.
<page>ContentEn, <page>ContentBm, <page>ContentCn string (HTML) Text of a legal page in English, Malay and Chinese.
<page>LastUpdatedDate string (max 255) Date shown to customers as the last update. Free text.
zoo*, jp*, email* string, integer, boolean Integration settings (below).
createdAt, updatedAt string yyyy-MM-dd HH:mm:ss, Malaysia time. Read-only.

<page> is one of privacyPolicy, termsOfPurchase, termsOfService, faq, contactUs, refundPolicy. Content is stored as HTML and returned unchanged.

Integration settings fields:

Group Fields
POS (Zoo) zooApiBaseUrl, zooQrEndpoint, zooTokenEndpoint, zooTicketEndpoint, zooApiUsername, zooApiPassword
Payment gateway jpGatewayUrl, jpPaymentEndpoint, jpRedflowEndpoint, jpBankListEndpoint, jpApiKey, jpAgToken
Email sender emailHost, emailPort, emailUsername, emailPassword, emailFrom, emailUseSsl, optional emailClientId, emailClientSecret, emailRefreshToken

Credentials in the response

GET /api/settings/{workspaceId}/general returns the integration settings, including passwords and keys, in clear text. Never forward the response to a browser or log it.

A public page response, here the privacy policy:

{
  "respCode": 2000,
  "respDesc": "Success",
  "result": {
    "privacyPolicyContentEn": "<p>English text</p>",
    "privacyPolicyContentBm": "<p>Teks Bahasa Melayu</p>",
    "privacyPolicyContentCn": "<p>中文内容</p>",
    "privacyPolicyLastUpdatedDate": "2026-11-16"
  }
}

Lists

Tenancy lists do not use the success envelope or the meta object of the other domains. Only two lists are paginated: organization users and workspace members. They take page (from 1, default 1) and limit (default 20; a value below 1 or above 100 becomes 20, not 100) and return items, total, page, limit and hasNext. Every other list returns all items, in one of these shapes:

Route Body Order
Organizations { "orgs": [ … ] } Newest first
Applications { "applications": [ … ] } Newest first
Apps { "apps": [ … ] } Not stated
Workspaces, teams, roles, role members A JSON array Workspaces and teams: newest first. Roles: by scope, then name. Role members: by name
Team members, team workspace roles, workspace teams { "items": [ … ] } As in the route's description
curl "https://<API_HOST>/api/v1/tenancy/organizations/{orgId}/workspaces/{workspaceId}/members?page=1&limit=20" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"
{
  "items": [
    { "userId": "usr_01HZX9", "name": "Ada Lovelace", "email": "ada@example.com", "role": "WORKSPACE_ADMIN" }
  ],
  "total": 1,
  "page": 1,
  "limit": 20,
  "hasNext": false
}

Lifecycle or states

An organization has a status that decides whether its users can sign in:

Status Meaning Moves to
pending A self-signup application waiting for approval. active (approve) or deleted (reject)
active The organization works normally. disabled
disabled Sign-in is blocked. active

See Organizations for the approval steps.

Errors

Routes under /api/v1/tenancy return {"error": "<reason>"}. The general settings routes return {"respCode": 4000, "respDesc": "<reason>", "result": null}. Permission failures return {"message": "..."}.

Status When What to do
400 A required field is missing or invalid. Fix the request.
401 No token, or an invalid or expired token. Sign in again.
403 The token lacks the permission, or the ID belongs to another organization. Ask an administrator to grant the permission, or use the right ID.
404 The item does not exist, or the public page could not be read. Check the ID.
409 The change conflicts with an existing item, such as a duplicate name. Choose another value, or remove the conflict.

Example bodies:

{ "error": "name is required" }

400, and the same shape for 404, 409 and 500. A handler that returns a bare status instead gives { "success": false, "error": "Bad Request" } (also "Forbidden", "Not Found").

{ "message": "Unauthorized - No token provided" }

401 from the token check. The text after the dash changes with the cause (for example Invalid token format).

{ "message": "Forbidden - Insufficient permissions" }

403 from the permission check.

{ "respCode": 4000, "respDesc": "<reason>", "result": null }

400 from the general settings routes. A 404 there has respDesc starting Error getting general:.

Endpoints

General settings of a workspace's ticketing site. The endpoints of the other resources are on their pages.