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

# Create a contact and enroll it in a campaign

> Creates (or updates, if a matching contact already exists) a Revve contact from a phone number and enrolls it into a campaign in one call. Use this when the contact doesn't exist in Revve yet — for example, a lead arriving straight from your core system or CRM. If `campaignId` is omitted, this only creates/updates the contact without enrolling it in anything.



## OpenAPI

````yaml /api-reference/openapi.json post /api/campaigns/contact-enrollments
openapi: 3.1.0
info:
  title: Revve AI API
  description: >-
    Endpoints for integrating your own systems with Revve — enrolling contacts
    into campaigns from your CRM, core banking system, or any external source.
  version: 1.0.0
servers:
  - url: https://app.revve.ai
security:
  - bearerApiKey: []
paths:
  /api/campaigns/contact-enrollments:
    post:
      summary: Create a contact and enroll it in a campaign
      description: >-
        Creates (or updates, if a matching contact already exists) a Revve
        contact from a phone number and enrolls it into a campaign in one call.
        Use this when the contact doesn't exist in Revve yet — for example, a
        lead arriving straight from your core system or CRM. If `campaignId` is
        omitted, this only creates/updates the contact without enrolling it in
        anything.
      operationId: createAndEnrollContact
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - phoneNumber
                - teamId
              properties:
                phoneNumber:
                  type: string
                  description: The contact's phone number.
                teamId:
                  type: string
                  description: >-
                    Your Revve team ID. Must match the team the API key belongs
                    to.
                campaignId:
                  type: string
                  description: >-
                    Optional. The campaign to enroll the contact in. Omit to
                    create/update the contact only, without enrolling.
                name:
                  type: string
                email:
                  type: string
                companyName:
                  type: string
                companyWebsite:
                  type: string
                timezone:
                  type: string
              additionalProperties:
                description: >-
                  Any other property is accepted and stored as a custom field on
                  the contact.
      responses:
        '200':
          description: Contact created/updated (and enrolled, if `campaignId` was given).
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: success
                  contactId:
                    type: string
        '400':
          description: Missing `phoneNumber` or `teamId`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: >-
            Missing `Authorization` header, or the API key is invalid for the
            given `teamId`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
  securitySchemes:
    bearerApiKey:
      type: http
      scheme: bearer
      description: >-
        Pass your team's API key as a Bearer token: `Authorization: Bearer
        YOUR_API_KEY`. Find your API key in the dashboard under Settings. The
        key must belong to the same team as the `teamId` in the request body.

````