{"openapi": "3.0.2", "info": {"title": "Samaya Public API", "version": "1.0", "description": ""}, "paths": {"/v1/orgs/": {"get": {"operationId": "samaya_api_rest_views_teams_list_orgs", "summary": "List Orgs", "parameters": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OrgListResponse"}}}}}, "description": "List all organizations under the authenticated customer.", "tags": ["Organizations"], "security": [{"WorkOsM2MAuth": []}]}}, "/v1/orgs/{org_id}/teams": {"get": {"operationId": "samaya_api_rest_views_teams_list_teams", "summary": "List Teams", "parameters": [{"in": "path", "name": "org_id", "schema": {"title": "Org Id", "type": "integer"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TeamListResponse"}}}}}, "description": "List all teams in the organization (excludes 'My Documents' teams).", "tags": ["Teams"], "security": [{"WorkOsM2MAuth": []}]}}, "/v1/orgs/{org_id}/teams/{team_id}/members": {"get": {"operationId": "samaya_api_rest_views_teams_list_team_members", "summary": "List Team Members", "parameters": [{"in": "path", "name": "org_id", "schema": {"title": "Org Id", "type": "integer"}, "required": true}, {"in": "path", "name": "team_id", "schema": {"title": "Team Id", "type": "integer"}, "required": true}, {"in": "query", "name": "cursor", "schema": {"title": "Cursor", "type": "string"}, "required": false}, {"in": "query", "name": "limit", "schema": {"title": "Limit", "default": 100, "minimum": 1, "maximum": 500, "type": "integer"}, "required": false}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaginatedTeamMembersResponse"}}}}}, "description": "List members of a team with pagination.", "tags": ["Teams"], "security": [{"WorkOsM2MAuth": []}]}, "post": {"operationId": "samaya_api_rest_views_teams_add_team_members", "summary": "Add Team Members", "parameters": [{"in": "path", "name": "org_id", "schema": {"title": "Org Id", "type": "integer"}, "required": true}, {"in": "path", "name": "team_id", "schema": {"title": "Team Id", "type": "integer"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BulkAddResponse"}}}}}, "description": "Bulk add users to a team by email. Returns partial success.", "tags": ["Teams"], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/AddMembersRequest"}}}, "required": true}, "security": [{"WorkOsM2MAuth": []}]}, "delete": {"operationId": "samaya_api_rest_views_teams_remove_team_members", "summary": "Remove Team Members", "parameters": [{"in": "path", "name": "org_id", "schema": {"title": "Org Id", "type": "integer"}, "required": true}, {"in": "path", "name": "team_id", "schema": {"title": "Team Id", "type": "integer"}, "required": true}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BulkRemoveResponse"}}}}}, "description": "Bulk remove users from a team by email. Returns partial success.", "tags": ["Teams"], "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/RemoveMembersRequest"}}}, "required": true}, "security": [{"WorkOsM2MAuth": []}]}}, "/v1/orgs/{org_id}/users": {"get": {"operationId": "samaya_api_rest_views_teams_list_users", "summary": "List Users", "parameters": [{"in": "path", "name": "org_id", "schema": {"title": "Org Id", "type": "integer"}, "required": true}, {"in": "query", "name": "email", "schema": {"title": "Email", "type": "string"}, "required": false}, {"in": "query", "name": "cursor", "schema": {"title": "Cursor", "type": "string"}, "required": false}, {"in": "query", "name": "limit", "schema": {"title": "Limit", "default": 100, "minimum": 1, "maximum": 500, "type": "integer"}, "required": false}], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaginatedUsersResponse"}}}}}, "description": "List users in the organization. Optionally filter by email.", "tags": ["Users"], "security": [{"WorkOsM2MAuth": []}]}}}, "components": {"schemas": {"OrgOut": {"title": "OrgOut", "type": "object", "properties": {"id": {"title": "Id", "type": "integer"}, "name": {"title": "Name", "type": "string"}}, "required": ["id", "name"]}, "OrgListResponse": {"title": "OrgListResponse", "type": "object", "properties": {"orgs": {"title": "Orgs", "type": "array", "items": {"$ref": "#/components/schemas/OrgOut"}}}, "required": ["orgs"]}, "TeamOut": {"title": "TeamOut", "type": "object", "properties": {"id": {"title": "Id", "type": "integer"}, "name": {"title": "Name", "type": "string"}, "is_customer_modifiable": {"title": "Is Customer Modifiable", "type": "boolean"}}, "required": ["id", "name", "is_customer_modifiable"]}, "TeamListResponse": {"title": "TeamListResponse", "type": "object", "properties": {"teams": {"title": "Teams", "type": "array", "items": {"$ref": "#/components/schemas/TeamOut"}}}, "required": ["teams"]}, "TeamMemberOut": {"title": "TeamMemberOut", "type": "object", "properties": {"email": {"title": "Email", "type": "string"}, "role": {"title": "Role", "type": "string"}, "is_active": {"title": "Is Active", "type": "boolean"}}, "required": ["email", "role", "is_active"]}, "PaginatedTeamMembersResponse": {"title": "PaginatedTeamMembersResponse", "type": "object", "properties": {"data": {"title": "Data", "type": "array", "items": {"$ref": "#/components/schemas/TeamMemberOut"}}, "next_cursor": {"title": "Next Cursor", "type": "string"}, "has_more": {"title": "Has More", "type": "boolean"}}, "required": ["data", "has_more"]}, "AddedMember": {"title": "AddedMember", "type": "object", "properties": {"email": {"title": "Email", "type": "string"}, "role": {"title": "Role", "type": "string"}}, "required": ["email", "role"]}, "MemberError": {"title": "MemberError", "type": "object", "properties": {"email": {"title": "Email", "type": "string"}, "detail": {"title": "Detail", "type": "string"}}, "required": ["email", "detail"]}, "BulkAddResponse": {"title": "BulkAddResponse", "type": "object", "properties": {"added": {"title": "Added", "type": "array", "items": {"$ref": "#/components/schemas/AddedMember"}}, "errors": {"title": "Errors", "type": "array", "items": {"$ref": "#/components/schemas/MemberError"}}}, "required": ["added", "errors"]}, "MemberEntry": {"title": "MemberEntry", "type": "object", "properties": {"email": {"title": "Email", "type": "string"}, "role": {"title": "Role", "default": "MEMBER", "type": "string"}}, "required": ["email"]}, "AddMembersRequest": {"title": "AddMembersRequest", "type": "object", "properties": {"members": {"title": "Members", "type": "array", "items": {"$ref": "#/components/schemas/MemberEntry"}}}, "required": ["members"]}, "BulkRemoveResponse": {"title": "BulkRemoveResponse", "type": "object", "properties": {"removed": {"title": "Removed", "type": "array", "items": {"type": "string"}}, "errors": {"title": "Errors", "type": "array", "items": {"$ref": "#/components/schemas/MemberError"}}}, "required": ["removed", "errors"]}, "RemoveMembersRequest": {"title": "RemoveMembersRequest", "type": "object", "properties": {"emails": {"title": "Emails", "type": "array", "items": {"type": "string"}}}, "required": ["emails"]}, "UserOut": {"title": "UserOut", "type": "object", "properties": {"email": {"title": "Email", "type": "string"}, "is_active": {"title": "Is Active", "type": "boolean"}}, "required": ["email", "is_active"]}, "PaginatedUsersResponse": {"title": "PaginatedUsersResponse", "type": "object", "properties": {"data": {"title": "Data", "type": "array", "items": {"$ref": "#/components/schemas/UserOut"}}, "next_cursor": {"title": "Next Cursor", "type": "string"}, "has_more": {"title": "Has More", "type": "boolean"}}, "required": ["data", "has_more"]}}, "securitySchemes": {"WorkOsM2MAuth": {"type": "http", "scheme": "bearer"}}}, "servers": null}