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

# Create audience

> **Endpoint:** `v1/audiences`

Create a new audience for managing contacts.




## OpenAPI

````yaml api-reference/openapi.yml post /audiences
openapi: 3.1.0
info:
  title: Send Email API
  description: >
    Send transactional emails through MailDiver.


    ### Base URL

    All API endpoints are prefixed with `api.` subdomain:

    ```

    https://api.maildiver.com

    ```


    For the self-hosted version, if your domain is `example.com`:

    ```

    https://api.example.com

    ```


    ### Endpoint

    ```

    v1/emails

    ```


    ### Authentication

    All API requests require authentication using your API key in the
    Authorization header:

    ```

    Authorization: Bearer your-api-key

    ```
  version: 1.0.0
  license:
    name: MIT
servers:
  - url: https://api.maildiver.com/v1
    description: Production server
    variables:
      domain:
        default: yourdomain.com
        description: Your domain (without the api. prefix)
security:
  - bearerAuth: []
paths:
  /audiences:
    post:
      tags:
        - Audience
      summary: Create audience
      description: |
        **Endpoint:** `v1/audiences`

        Create a new audience for managing contacts.
      operationId: createAudience
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                  description: |
                    Audience name. Must be:
                    - At least 1 character long
                    - Maximum 100 characters
                  minLength: 1
                  maxLength: 100
                  example: Weekly newsletter subscribers
            examples:
              valid:
                summary: Valid audience name
                value:
                  name: Weekly newsletter subscribers
              invalid:
                summary: Invalid audience name
                value:
                  name: ''
      responses:
        '200':
          description: Audience successfully created
          content:
            application/json:
              examples:
                success:
                  summary: Success response
                  value:
                    id: 0195ceb7-f8cb-7558-b3aa-1280acb8b417
        '400':
          description: Bad request
          content:
            application/json:
              examples:
                invalidLength:
                  summary: Invalid name length
                  value:
                    message: name must be between 1 and 100 characters
        '403':
          description: Forbidden (API key is missing or invalid)
          content:
            application/json:
              examples:
                invalidKey:
                  summary: Invalid API key error
                  value:
                    message: Invalid API key
                    code: invalid_api_key
                invalidHeader:
                  summary: Invalid authorization header error
                  value:
                    message: Invalid authorization header
                    code: invalid_authorization_header
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key with format "Bearer {your-api-key}"

````