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

# Create or update a contact

> Upserts by email within the account. A contact must belong to at least one audience, so audienceIds is required and non-empty.



## OpenAPI

````yaml /openapi.json post /marketing/contacts
openapi: 3.0.0
info:
  title: JetEmail API
  version: 1.0.0
  description: API documentation for JetEmail's transactional email service.
servers:
  - url: https://api.jetemail.com
    description: Production
security:
  - apiKeyAuth: []
tags:
  - name: Email
    description: Send transactional email
  - name: Outbound
    description: 'Outbound sending: keys, SMTP users, domains, logs, suppression'
  - name: Inbound
    description: Inbound routing, domains and forward destinations
  - name: Marketing
    description: >-
      Marketing suite: templates, audiences, contacts, broadcasts, themes,
      assets
externalDocs:
  description: Download OpenAPI Specification
  url: /openapi.json
paths:
  /marketing/contacts:
    post:
      tags:
        - Marketing
      summary: Create or update a contact
      description: >-
        Upserts by email within the account. A contact must belong to at least
        one audience, so audienceIds is required and non-empty.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
                - audienceIds
              properties:
                email:
                  type: string
                firstName:
                  type: string
                lastName:
                  type: string
                attributes:
                  type: object
                  description: Custom merge fields
                status:
                  type: string
                  enum:
                    - subscribed
                    - unsubscribed
                audienceIds:
                  type: array
                  items:
                    type: string
                  minItems: 1
                  description: At least one audience (required)
      responses:
        '200':
          description: Upserted
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  id:
                    type: string
        '400':
          description: Invalid email or no audience provided
components:
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      description: API key for account management endpoints. Use your api_ prefixed token.

````