openapi: 3.2.0 info: title: Account Management Teams API description: ValiMail Integration API version: 1.0.0 servers: - url: https://api.valimail.com description: API services - url: https://api.valimail-staging.com description: Stage test server - url: http://localhost:7001 description: Local development server security: - bearerAuth: [] tags: - name: Teams paths: /accounts/{slug}/teams: get: summary: Returns teams linked to the account slug provided. tags: - Teams parameters: - name: slug in: path description: Account slug to be queried. required: true schema: type: string example: valimail responses: '200': description: OK - List of the Teams linked to the account slug are provided content: application/json: schema: type: array items: $ref: '#/components/schemas/Team' '400': description: Bad Request - Invalid input data content: application/json: schema: $ref: '#/components/schemas/ValidationResponse' '401': description: Unauthorized - Authentication failed content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '403': description: Forbidden - Authorization failed content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '422': description: Unprocessable Entity - Failed to normalize or parse content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '429': description: Over Rate - Rate limit exceeded content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '500': description: Internal Server Error - Service, database, or unclassified error content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' post: summary: Creates a new team linked to the account slug provided. tags: - Teams parameters: - name: slug in: path description: Account slug to create a team. required: true schema: type: string example: valimail requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/TeamCreate' responses: '200': description: Ok - New team created. content: application/json: schema: $ref: '#/components/schemas/Team' '400': description: Bad Request - Invalid input data content: application/json: schema: $ref: '#/components/schemas/ValidationResponse' '401': description: Unauthorized - Authentication failed content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '403': description: Forbidden - Authorization failed content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '422': description: Unprocessable Entity - Failed to normalize or parse content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '429': description: Over Rate - Rate limit exceeded content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '500': description: Internal Server Error - Service, database, or unclassified error content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /accounts/{slug}/teams/{team-slug}: get: summary: Returns team data by account slug and team slug. tags: - Teams parameters: - name: slug in: path description: Account slug to be queried. required: true schema: type: string example: valimail - name: team-slug in: path description: Team slug to be queried. required: true schema: type: string example: engineering responses: '200': description: Ok - Single Team is provided content: application/json: schema: $ref: '#/components/schemas/Team' '400': description: Bad Request - Invalid input data content: application/json: schema: $ref: '#/components/schemas/ValidationResponse' '401': description: Unauthorized - Authentication failed content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '403': description: Forbidden - Authorization failed content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '404': description: Not Found - Account or team not found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '422': description: Unprocessable Entity - Failed to normalize or parse content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '429': description: Over Rate - Rate limit exceeded content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '500': description: Internal Server Error - Service, database, or unclassified error content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: summary: Updates team data by account slug and team slug. tags: - Teams parameters: - name: slug in: path description: Account slug to update a team. required: true schema: type: string example: valimail - name: team-slug in: path description: Team slug to be updated. required: true schema: type: string example: engineering requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/TeamCreate' responses: '200': description: Ok - Team updated. content: application/json: schema: $ref: '#/components/schemas/Team' '400': description: Bad Request - Invalid input data content: application/json: schema: $ref: '#/components/schemas/ValidationResponse' '401': description: Unauthorized - Authentication failed content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '403': description: Forbidden - Authorization failed content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '404': description: Not Found - Account or team not found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '422': description: Unprocessable Entity - Failed to normalize or parse content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '429': description: Over Rate - Rate limit exceeded content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '500': description: Internal Server Error - Service, database, or unclassified error content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' components: schemas: ValidationResponse: type: object properties: params: type: string detail: type: array items: $ref: '#/components/schemas/ValidationDetail' ValidationDetail: type: object properties: field: type: string value: type: string message: type: string ErrorResponse: type: object properties: request: type: string message: type: string type: type: string request-id: type: string call: type: string TeamCreate: type: object properties: name: description: Name of the team. type: string description: description: Description of the team. type: string saml-group-id: description: Optional SAML group ID used to auto-assign SSO users to this team. type: string Team: type: object properties: name: type: string description: type: string slug: type: string saml-group-id: type: string description: Present when the team is linked to a SAML group for SSO-based assignment. example: name: Engineering description: Engineering team slug: engineering saml-group-id: eng-saml-group securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT