Tray.ai Users API

Manage external users of your embedded application. Requires a master token for most operations.

Operations 6

POST /graphql Tray.ai Create External User #
POST /graphql#getUsers Tray.ai Get Users #
POST /graphql#updateExternalUser Tray.ai Update External User #
POST /graphql#removeUser Tray.ai Remove User #
GET /users Tray.ai List Users #
POST /users/invite Tray.ai Invite User #

Documentation

Specifications

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/tray-ai-users-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

tray-ai-users-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Tray Ai Users API
  version: 1.0.0
  contact:
    name: Tray.ai Support
    url: https://tray.ai
  license:
    name: Proprietary
    url: https://tray.ai/terms
  termsOfService: https://tray.ai/terms
  description: 'Operations tagged Users across 2 of this provider''s published API definitions: tray-ai-embedded-api-openapi.yml, tray-ai-platform-api-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://tray.io
  description: US Region (Default)
- url: https://eu1.tray.io
  description: EU Region
- url: https://ap1.tray.io
  description: APAC Region
- url: https://api.tray.io/core/v1
  description: US Region (Default)
- url: https://api.eu1.tray.io/core/v1
  description: EU Region
- url: https://api.ap1.tray.io/core/v1
  description: APAC Region
security:
- bearerAuth: []
tags:
- name: Users
  description: Manage external users of your embedded application. Requires a master token for most operations.
paths:
  /graphql:
    post:
      operationId: createExternalUser
      summary: Tray.ai Create External User
      description: Creates a new external user for your embedded application. Accepts a name, externalUserId, and optional isTestUser flag. Test users are excluded from billing. Requires a master token.
      tags:
      - Users
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GraphQLRequest'
            example:
              query: "mutation {\n  createExternalUser(input: {\n    name: \"Jane Doe\",\n    externalUserId: \"user-123\",\n    isTestUser: false\n  }) {\n    userId\n  }\n}"
      responses:
        '200':
          description: User created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      createExternalUser:
                        type: object
                        properties:
                          userId:
                            type: string
                            description: The unique identifier for the created user
        '401':
          $ref: '#/components/responses/Unauthorized'
    servers:
    - url: https://tray.io
      description: US Region (Default)
    - url: https://eu1.tray.io
      description: EU Region
    - url: https://ap1.tray.io
      description: APAC Region
  /graphql#getUsers:
    post:
      operationId: getUsers
      summary: Tray.ai Get Users
      description: Retrieves a list of external users with pagination support. Returns user details including name, id, externalUserId, and pagination cursor information. Requires a master token.
      tags:
      - Users
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GraphQLRequest'
            example:
              query: "query {\n  users {\n    edges {\n      node {\n        id\n        name\n        externalUserId\n      }\n      cursor\n    }\n    pageInfo {\n      hasNextPage\n      endCursor\n      hasPreviousPage\n      startCursor\n    }\n  }\n}"
      responses:
        '200':
          description: List of users returned successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      users:
                        type: object
                        properties:
                          edges:
                            type: array
                            items:
                              type: object
                              properties:
                                node:
                                  $ref: '#/components/schemas/User'
                                cursor:
                                  type: string
                          pageInfo:
                            $ref: '#/components/schemas/PageInfo'
        '401':
          $ref: '#/components/responses/Unauthorized'
    servers:
    - url: https://tray.io
      description: US Region (Default)
    - url: https://eu1.tray.io
      description: EU Region
    - url: https://ap1.tray.io
      description: APAC Region
  /graphql#updateExternalUser:
    post:
      operationId: updateExternalUser
      summary: Tray.ai Update External User
      description: Updates an external user's properties, such as marking them as a test user to exclude from billing. Requires a master token.
      tags:
      - Users
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GraphQLRequest'
            example:
              query: "mutation {\n  updateExternalUser(input: {\n    userId: \"user-uuid-here\",\n    isTestUser: true\n  }) {\n    userId\n  }\n}"
      responses:
        '200':
          description: User updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      updateExternalUser:
                        type: object
                        properties:
                          userId:
                            type: string
        '401':
          $ref: '#/components/responses/Unauthorized'
    servers:
    - url: https://tray.io
      description: US Region (Default)
    - url: https://eu1.tray.io
      description: EU Region
    - url: https://ap1.tray.io
      description: APAC Region
  /graphql#removeUser:
    post:
      operationId: removeUser
      summary: Tray.ai Remove User
      description: Removes an external user from your embedded application. This will also remove all associated solution instances and authentications. Requires a master token.
      tags:
      - Users
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GraphQLRequest'
            example:
              query: "mutation {\n  removeUser(input: {\n    userId: \"user-uuid-here\"\n  }) {\n    clientMutationId\n  }\n}"
      responses:
        '200':
          description: User removed successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      removeUser:
                        type: object
                        properties:
                          clientMutationId:
                            type: string
        '401':
          $ref: '#/components/responses/Unauthorized'
    servers:
    - url: https://tray.io
      description: US Region (Default)
    - url: https://eu1.tray.io
      description: EU Region
    - url: https://ap1.tray.io
      description: APAC Region
  /users:
    get:
      operationId: listUsers
      summary: Tray.ai List Users
      description: Retrieves a list of users within the organization. Returns user details including name, email, and role information.
      tags:
      - Users
      responses:
        '200':
          description: Users returned successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  elements:
                    type: array
                    items:
                      $ref: '#/components/schemas/PlatformUser'
        '401':
          $ref: '#/components/responses/Unauthorized_2'
    servers:
    - url: https://api.tray.io/core/v1
      description: US Region (Default)
    - url: https://api.eu1.tray.io/core/v1
      description: EU Region
    - url: https://api.ap1.tray.io/core/v1
      description: APAC Region
  /users/invite:
    post:
      operationId: inviteUser
      summary: Tray.ai Invite User
      description: Invites a user to the organization by email address. The invited user will receive an email with instructions to join.
      tags:
      - Users
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InviteUserRequest'
      responses:
        '200':
          description: User invited successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformUser'
        '400':
          description: Invalid request
        '401':
          $ref: '#/components/responses/Unauthorized_2'
    servers:
    - url: https://api.tray.io/core/v1
      description: US Region (Default)
    - url: https://api.eu1.tray.io/core/v1
      description: EU Region
    - url: https://api.ap1.tray.io/core/v1
      description: APAC Region
components:
  schemas:
    User:
      type: object
      properties:
        id:
          type: string
          description: Tray internal user identifier
        name:
          type: string
          description: Display name of the user
        externalUserId:
          type: string
          description: External user identifier set during creation
        isTestUser:
          type: boolean
          description: Whether the user is marked as a test user (excluded from billing)
    PageInfo:
      type: object
      properties:
        hasNextPage:
          type: boolean
          description: Whether there are more results after the current page
        endCursor:
          type: string
          description: Cursor for fetching the next page
        hasPreviousPage:
          type: boolean
          description: Whether there are results before the current page
        startCursor:
          type: string
          description: Cursor for fetching the previous page
    GraphQLRequest:
      type: object
      required:
      - query
      properties:
        query:
          type: string
          description: The GraphQL query or mutation string
        variables:
          type: object
          description: Variables to pass to the GraphQL query or mutation
        operationName:
          type: string
          description: The name of the operation to execute if the query contains multiple operations
    GraphQLError:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
                description: Error message
              locations:
                type: array
                items:
                  type: object
                  properties:
                    line:
                      type: integer
                    column:
                      type: integer
              path:
                type: array
                items:
                  type: string
    InviteUserRequest:
      type: object
      required:
      - email
      properties:
        email:
          type: string
          format: email
          description: Email address to send the invitation to
        role:
          type: string
          description: Role to assign to the invited user
        workspaceId:
          type: string
          description: Optional workspace to assign the user to
    PlatformUser:
      type: object
      properties:
        id:
          type: string
          description: Unique user identifier
        name:
          type: string
          description: Display name of the user
        email:
          type: string
          format: email
          description: Email address of the user
        role:
          type: string
          description: Role of the user in the organization
        status:
          type: string
          description: Account status (active, invited, etc.)
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error type
        message:
          type: string
          description: Human-readable error message
        statusCode:
          type: integer
          description: HTTP status code
  responses:
    Unauthorized:
      description: Authentication failed. The bearer token is missing, invalid, or does not have sufficient permissions for the requested operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GraphQLError'
    Unauthorized_2:
      description: Authentication failed. The bearer token is missing, invalid, or does not have sufficient permissions for the requested operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Use either a master token (obtained from Tray Embedded UI settings) or a user token (obtained via the authorize mutation). Master tokens are required for admin operations like managing users. User tokens are required for user-scoped operations like managing solution instances.
x-refined-from:
- tray-ai-embedded-api-openapi.yml
- tray-ai-platform-api-openapi.yml