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

# Import an off-platform marketing opt-in

> Adds an email address collected outside Let's Do This, for example by a Webflow form, to your subscriber list, subscribed to marketing.

## How to use it

- Use it only for people who explicitly opted in.
- Send their name and postcode too, if the form collected them.
- Send a stable `originId` for each opt-in. Retrying with the same `originId` leaves the subscription as it is, even if the person has unsubscribed since. A retry only adds a name or postcode it carries.
- Each request takes one address and answers straight away. If the opt-in isn't saved, the request fails, so you can retry it.



## OpenAPI

````yaml /openapi.json post /v0/opt-ins
openapi: 3.1.0
info:
  title: Let's Do This API
  version: 0.1.0
  description: >
    The full reference — getting started, pagination, error responses, rate
    limits and the changelog — lives at

    [partner-help.letsdothis.com/api-reference](https://partner-help.letsdothis.com/api-reference/overview).

    This page is the interactive OpenAPI view of the same specification.


    # Authentication


    Create an API key from **Settings** → **Credentials** in your Let's Do This
    account and send it as a bearer token:


    ```bash

    curl --request GET \
     --url "https://api.letsdothis.com/v0/participants" \
     --header "Authorization: Bearer YOUR-API-KEY"
    ```


    Keep the key secret: it identifies your organization, so do not ship it in a
    website or native app. If a key is exposed,

    revoke it from the same section and create a replacement.


    # OpenAPI schema


    Download the [OpenAPI schema](https://api.letsdothis.com/documentation/json)
    to use with Postman or an OpenAPI client

    generator.
servers:
  - url: https://api.letsdothis.com
    description: Production
  - url: https://api.staging.letsdothis.com
    description: Staging
security:
  - bearerAuth: []
tags:
  - name: Events
    x-group: Events
    description: Events that participants can register for.
  - name: EventOccurrences
    x-group: Event occurrences
    description: >-
      Event occurrences scoped to the organizer associated with your Public API
      credentials. Unlike the public Events catalog, results are limited to your
      own events.
  - name: Races
    x-group: Races
    description: >-
      Races within an event occurrence. An event occurrence may have one or more
      races, for example a 5K and a 10K within the same race day.
  - name: Tickets
    x-group: Tickets
    description: Tickets that are available for events.
  - name: BookingForms
    x-group: Booking forms
    description: >-
      Booking forms define the questions a booker answers when registering for a
      ticket. A ticket usually references a single booking form, so expect zero
      or one, while a booking form may be shared across multiple tickets.
  - name: BookingFormFields
    x-group: Booking form fields
    description: >-
      Booking form fields are the individual questions on a booking form — their
      type, label, options, and whether an answer is required. A field can be
      reused across multiple forms.
  - name: Bookings
    x-group: Bookings
    description: >-
      Bookings are the transaction record for a registration. A booking may
      contain one or more participants (entries).
  - name: Membership
    x-group: Memberships
    description: >-
      Membership schemes, purchased policies and the seats on them, owned by
      your organizer. Policies are billing contracts; a seat is one person's
      place on a policy.
  - name: Participant
    x-group: Participants
    description: Participants are users who successfully booked an event.
  - name: LineItem
    x-group: Line items
    description: Financial details related to individual items within transactions.
  - name: AddOns
    x-group: Add-ons
    description: >-
      Your add-on products, such as merchandise or extras, that participants buy
      with their entry. Imported products keep the ids you gave them.
  - name: DiscountCodes
    x-group: Discount codes
    description: >-
      Discount codes participants enter at checkout to reduce the price of a
      booking.
  - name: Credits
    x-group: Credits
    description: >-
      Credits are balances participants can spend at checkout, identified by
      their email address.
  - name: Referrals
    x-group: Referrals
    description: >-
      Referral programs, the referrers registered on them, and asynchronous
      imports of historical referrals.
  - name: Teams
    x-group: Teams
    description: >-
      Teams group participants of an event occurrence under a team program.
      Teams can be imported for participants whose bookings were imported.
  - name: Application
    x-group: Applications
    description: >-
      Applications are created when a user applies for tickets that are set up
      to require an application process, such as balloted or "Good For Age"
      entries.
  - name: Partner
    x-group: Partners
    description: >-
      Partners that were created by the organization who can have Reserved
      Entries assigned to them.
  - name: ReservedEntries
    x-group: Reserved entries
    description: >-
      Reserved Entries are entries that are reserved for a partner. After being
      assigned, the partner can then allocate these entries to participants.
  - name: Timing
    x-group: Timing
    description: >-
      Timing providers push bib numbers and bib-pack shipments back to Let's Do
      This for the startlist entries they received. Available to select timing
      partners only.
  - name: Identity
    x-group: API key
    description: >-
      What your API key can reach. Available to every key, including scoped
      ones.
paths:
  /v0/opt-ins:
    post:
      tags:
        - Participant
      summary: Import an off-platform marketing opt-in
      description: >-
        Adds an email address collected outside Let's Do This, for example by a
        Webflow form, to your subscriber list, subscribed to marketing.


        ## How to use it


        - Use it only for people who explicitly opted in.

        - Send their name and postcode too, if the form collected them.

        - Send a stable `originId` for each opt-in. Retrying with the same
        `originId` leaves the subscription as it is, even if the person has
        unsubscribed since. A retry only adds a name or postcode it carries.

        - Each request takes one address and answers straight away. If the
        opt-in isn't saved, the request fails, so you can retry it.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                emailAddress:
                  type: string
                  maxLength: 320
                  format: email
                  pattern: >-
                    ^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                source:
                  type: string
                  minLength: 1
                  maxLength: 64
                originId:
                  type: string
                  minLength: 1
                  maxLength: 255
                firstName:
                  type: string
                  maxLength: 100
                lastName:
                  type: string
                  maxLength: 100
                postcode:
                  description: >-
                    The subscriber's postcode, if the form collected one. Send
                    it as text or a number. We keep it as sent, with no format
                    check. If it is over 20 characters, we leave it out and
                    still save the sign-up. A blank postcode never clears a
                    stored one.
                  type:
                    - string
                    - number
              required:
                - emailAddress
                - source
                - originId
              additionalProperties: false
      responses:
        '200':
          description: >-
            The opt-in was saved. `emailAddress` and `postcode` show what was
            stored.
          content:
            application/json:
              schema:
                type: object
                properties:
                  emailAddress:
                    type: string
                    description: The normalised address associated with the opt-in event
                  postcode:
                    description: >-
                      The postcode stored for this subscriber and organiser, if
                      any.
                    type: string
                required:
                  - emailAddress
                additionalProperties: false
        '400':
          description: >-
            The request is invalid. `message` says why, and `issues` lists each
            field that was rejected.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    enum:
                      - validation_failed
                      - invalid_request
                  message:
                    type: string
                  issues:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                          description: >-
                            Dot-separated path to the rejected field. When it
                            differs from the request you sent, `sourcePath`
                            names the field as sent.
                        sourcePath:
                          type: string
                          description: >-
                            Dot-separated path to the same field in the
                            submitted payload.
                        code:
                          type: string
                        message:
                          type: string
                      required:
                        - path
                        - code
                        - message
                required:
                  - error
                  - message
                  - issues
        '401':
          description: The API key is missing, invalid or revoked.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    enum:
                      - 401
                  error:
                    type: string
                  message:
                    type: string
        '403':
          description: >-
            Your organization or API key isn't allowed to do this. `message`
            says why.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    enum:
                      - 403
                  error:
                    type: string
                  message:
                    type: string
        '404':
          description: Not found. `message` says what's missing.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    enum:
                      - 404
                  error:
                    type: string
                  message:
                    type: string
        '409':
          description: >-
            The request conflicts with the record's current state. `message`
            says how.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    enum:
                      - 409
                  error:
                    type: string
                  message:
                    type: string
        '413':
          description: The request body is too large.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    enum:
                      - 413
                  error:
                    type: string
                  message:
                    type: string
        '415':
          description: >-
            The request body isn't JSON. Send it with `Content-Type:
            application/json`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    enum:
                      - 415
                  error:
                    type: string
                  message:
                    type: string
        '429':
          description: >-
            Too many requests. Wait the number of seconds in `retry-after` when
            the response has it, or back off for a few seconds, then retry.
          headers:
            retry-after:
              schema:
                type: integer
              description: Seconds to wait before retrying the request.
            x-ratelimit-limit:
              schema:
                type: integer
              description: Requests permitted in the current window.
            x-ratelimit-remaining:
              schema:
                type: integer
              description: Requests still permitted in the current window.
            x-ratelimit-reset:
              schema:
                type: integer
              description: Seconds until the current window resets.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    enum:
                      - 429
                  error:
                    type: string
                  message:
                    type: string
        '500':
          description: >-
            Something went wrong on our side. Retry, and if it keeps happening,
            contact your Let's Do This representative with the request id from
            the response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    enum:
                      - 500
                  error:
                    type: string
                  message:
                    type: string
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.