> ## Documentation Index
> Fetch the complete documentation index at: https://docs.primeintellect.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Bulk Email

> Send a templated email to the given users and to the contact address of
the given teams (subject + body, personalized with each recipient's name).

Authorizes ``emails:create`` per recipient, so a scoped grant may email only
the users/teams it names while a broad grant may email anyone.



## OpenAPI

````yaml https://api.primeintellect.ai/openapi.json post /api/admin/emails/send
openapi: 3.1.0
info:
  title: PI API
  version: 0.1.0
servers:
  - url: https://api.primeintellect.ai
security: []
paths:
  /api/admin/emails/send:
    post:
      tags:
        - admin-emails
      summary: Send Bulk Email
      description: >-
        Send a templated email to the given users and to the contact address of

        the given teams (subject + body, personalized with each recipient's
        name).


        Authorizes ``emails:create`` per recipient, so a scoped grant may email
        only

        the users/teams it names while a broad grant may email anyone.
      operationId: send_bulk_email_api_admin_emails_send_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendBulkEmailRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericResponse_SendBulkEmailResponse_'
        '401':
          description: Authorization failed
        '403':
          description: Insufficient permissions
        '422':
          description: Invalid request data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    SendBulkEmailRequest:
      properties:
        userIds:
          items:
            type: string
          type: array
          title: Userids
        teamIds:
          items:
            type: string
          type: array
          title: Teamids
        subject:
          type: string
          minLength: 1
          title: Subject
        body:
          type: string
          minLength: 1
          title: Body
      type: object
      required:
        - subject
        - body
      title: SendBulkEmailRequest
      description: Send a templated email to one or more users and/or team addresses.
    GenericResponse_SendBulkEmailResponse_:
      properties:
        data:
          anyOf:
            - $ref: '#/components/schemas/SendBulkEmailResponse'
            - type: 'null'
          description: Response data
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: Response status
      type: object
      title: GenericResponse[SendBulkEmailResponse]
    ErrorResponse:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Errors
      type: object
      required:
        - errors
      title: ErrorResponse
    SendBulkEmailResponse:
      properties:
        sent:
          type: integer
          title: Sent
        unresolvedUserIds:
          items:
            type: string
          type: array
          title: Unresolveduserids
        unresolvedTeamIds:
          items:
            type: string
          type: array
          title: Unresolvedteamids
      type: object
      required:
        - sent
      title: SendBulkEmailResponse
    ErrorDetail:
      properties:
        param:
          type: string
          title: Param
        details:
          type: string
          title: Details
      type: object
      required:
        - param
        - details
      title: ErrorDetail
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````