openapi: 3.2.0 info: title: Operations Hub Core.customers.users API version: 0.1.1 description: '' servers: [] tags: - name: core.customers.users paths: /api/core/v1/customers/{customer_id}/users: get: operationId: list_customer_users summary: List Users for Customer parameters: - in: path name: customer_id schema: title: Customer Id type: integer required: true - in: query name: search schema: anyOf: - type: string - type: 'null' description: Search by name (case-insensitive) title: Search required: false description: Search by name (case-insensitive) - in: query name: sort schema: anyOf: - type: string - type: 'null' description: Sort by field (prefix with - for descending) title: Sort required: false description: Sort by field (prefix with - for descending) - in: query name: paginate schema: default: true description: Enable pagination (false returns all results) title: Paginate type: boolean required: false description: Enable pagination (false returns all results) - in: query name: page schema: default: 1 description: Page number minimum: 1 title: Page type: integer required: false description: Page number - in: query name: page_size schema: default: 50 description: Number of items per page maximum: 1000 minimum: 1 title: Page Size type: integer required: false description: Number of items per page responses: '200': description: OK content: application/json: schema: items: $ref: '#/components/schemas/CustomerUserResponse' title: Response type: array '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/Error' description: List all child items for a parent with pagination, search, and sorting. tags: - core.customers.users security: - APIKeyAuth: [] - CookieAuth: [] post: operationId: create_customer_user summary: Create User parameters: - in: path name: customer_id schema: title: Customer Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/CustomerUserResponse' description: Create a new child item for the parent. tags: - core.customers.users requestBody: content: application/json: schema: $ref: '#/components/schemas/CustomerUserCreate' required: true security: - APIKeyAuth: [] - CookieAuth: [] /api/core/v1/customers/{customer_id}/users/{user_id}: get: operationId: get_customer_user summary: Get User parameters: - in: path name: customer_id schema: title: Customer Id type: integer required: true - in: path name: user_id schema: title: User Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/CustomerUserResponse' description: Get a single child item. tags: - core.customers.users security: - APIKeyAuth: [] - CookieAuth: [] patch: operationId: update_customer_user summary: Update User parameters: - in: path name: customer_id schema: title: Customer Id type: integer required: true - in: path name: user_id schema: title: User Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/CustomerUserResponse' description: Update a child item. tags: - core.customers.users requestBody: content: application/json: schema: $ref: '#/components/schemas/CustomerUserUpdate' required: true security: - APIKeyAuth: [] - CookieAuth: [] delete: operationId: delete_customer_user summary: Delete User parameters: - in: path name: customer_id schema: title: Customer Id type: integer required: true - in: path name: user_id schema: title: User Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Success' description: Soft delete a child item. tags: - core.customers.users security: - APIKeyAuth: [] - CookieAuth: [] components: schemas: UserObject: additionalProperties: false description: Nested user object for responses (no timestamps). properties: id: title: Id type: integer username: title: Username type: string email: anyOf: - type: string - type: 'null' title: Email first_name: anyOf: - type: string - type: 'null' title: First Name last_name: anyOf: - type: string - type: 'null' title: Last Name required: - id - username title: UserObject type: object CustomerUserResponse: additionalProperties: false description: Schema for CustomerUser response. properties: updated_at: description: Last update timestamp format: date-time title: Updated At type: string id: description: Customer user ID title: Id type: integer customer_id: description: Customer ID title: Customer Id type: integer user: $ref: '#/components/schemas/UserObject' description: User information customer_role_ids: description: Assigned role IDs items: type: integer title: Customer Role Ids type: array status: description: 'Membership lifecycle: INVITED | ACTIVE | DECLINED | EXPIRED' enum: - INVITED - ACTIVE - DECLINED - EXPIRED title: Status type: string required: - updated_at - id - customer_id - user - status title: CustomerUserResponse type: object Error: additionalProperties: false description: Error response schema. properties: code: $ref: '#/components/schemas/ErrorCode' message: title: Message type: string required: - code - message title: Error type: object CustomerUserUpdate: additionalProperties: false description: Schema for updating a CustomerUser. properties: user_id: anyOf: - type: integer - type: 'null' description: User ID title: User Id customer_role_ids: anyOf: - items: type: integer type: array - type: 'null' description: Role IDs (None = no change, [] = clear all) title: Customer Role Ids title: CustomerUserUpdate type: object Success: additionalProperties: false description: 'Schema returned for successful operations. The `success` field is always ``true`` in this schema. Failed operations are represented by the :class:`Error` schema instead, so a ``false`` value does not occur in practice. The field is included for consistency across responses and to make the contract explicit for clients.' properties: success: default: true description: Always true for this schema. Errors are represented by a separate Error schema, so false is never returned. title: Success type: boolean title: Success type: object CustomerUserCreate: additionalProperties: false description: Schema for creating a CustomerUser. properties: user_id: description: User ID title: User Id type: integer customer_role_ids: description: Role IDs to assign items: type: integer title: Customer Role Ids type: array required: - user_id title: CustomerUserCreate type: object ErrorCode: description: Error codes for API errors. enum: - validation - server - auth - unknown - external - generic title: ErrorCode type: string securitySchemes: APIKeyAuth: type: http scheme: bearer CookieAuth: type: apiKey in: cookie name: opshub_prod_sessionid AuthBearer: type: http scheme: bearer