Inflection.io Contacts API

The Contacts API from Inflection.io — 5 operation(s) for contacts.

OpenAPI Specification

inflectionio-contacts-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Inflection Developer Contact Activity Contacts API
  version: '1.0'
  description: A REST API for reading and writing the people in your Inflection workspace — their profiles, product and marketing activity, static lists, and email templates.
servers:
- url: https://api.inflection.io
  description: Production
security:
- bearerAuth: []
tags:
- name: Contacts
paths:
  /v1/contacts/{id}:
    get:
      operationId: getContactById
      summary: Get contact by ID
      tags:
      - Contacts
      description: Returns the full stored record under `data.properties` (snake_case keys). A missing contact returns `400 BAS-E-002` (not the more conventional `404`).
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Contact found.
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Envelope'
                - type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/Contact'
        '400':
          description: Contact not found (`BAS-E-002`).
    patch:
      operationId: updateContact
      summary: Update a contact
      tags:
      - Contacts
      description: Enqueues an update (PENDING transaction), applied asynchronously.
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                properties:
                  $ref: '#/components/schemas/ContactProperties'
      responses:
        '200':
          description: Update enqueued as a PENDING transaction.
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Envelope'
                - type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/Transaction'
  /v1/contacts/by-email/{email}:
    get:
      operationId: getContactByEmail
      summary: Get contact by email
      tags:
      - Contacts
      description: Returns the full stored record under `data.properties` (snake_case keys). URL-encode the email (`@` → `%40`). A missing contact returns `400 BAS-E-002`.
      parameters:
      - name: email
        in: path
        required: true
        schema:
          type: string
        example: jane%40acme.com
      responses:
        '200':
          description: Contact found.
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Envelope'
                - type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/Contact'
        '400':
          description: Contact not found (`BAS-E-002`).
  /v1/contacts:
    post:
      operationId: createContact
      summary: Create a contact
      tags:
      - Contacts
      description: 'Enqueues a new contact and returns a PENDING transaction. Keys inside `properties` must be **snake_case**.


        `POST` is **create-only**. Re-posting an existing email resolves to `FAILED` in the transaction result. To create-or-update, use **Batch upsert contacts** instead.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - email
              properties:
                email:
                  type: string
                  format: email
                properties:
                  $ref: '#/components/schemas/ContactProperties'
            example:
              email: jane@acme.com
              properties:
                first_name: Jane
                company_name: Acme
      responses:
        '200':
          description: Create enqueued as a PENDING transaction.
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Envelope'
                - type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/Transaction'
  /v1/contacts/batch:
    post:
      operationId: batchUpsertContacts
      summary: Batch upsert contacts
      tags:
      - Contacts
      description: Upserts up to 1,000 contacts in one transaction — new emails come back `CREATED`, existing ones `UPDATED`. This is the reliable create-or-update path for both new and existing contacts (single `POST` is create-only).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                contacts:
                  type: array
                  items:
                    type: object
                    properties:
                      email:
                        type: string
                        format: email
                      properties:
                        $ref: '#/components/schemas/ContactProperties'
            example:
              contacts:
              - email: jane@acme.com
                properties:
                  first_name: Jane
              - email: raj@globex.com
                properties:
                  company_name: Globex
      responses:
        '200':
          description: Batch enqueued as a PENDING transaction.
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Envelope'
                - type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/Transaction'
  /v1/contacts/transactions/{transactionId}:
    get:
      operationId: getContactTransaction
      summary: Get a transaction
      tags:
      - Contacts
      description: Returns `PENDING`, `DONE` (with per-contact `results`), or `NOT_EXIST` for an unknown id (still HTTP `200`). See [Asynchronous writes](/api-reference/async-writes).
      parameters:
      - name: transactionId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Transaction status.
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/Envelope'
                - type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/Transaction'
components:
  schemas:
    Transaction:
      type: object
      properties:
        transactionId:
          type: string
          example: 34-7e8009a7-2c91-409e-b5ac-0f1144a0cc7d
        status:
          type: string
          enum:
          - PENDING
          - DONE
          - NOT_EXIST
        data:
          type: object
          description: Present when status is DONE.
          properties:
            results:
              type: array
              items:
                type: object
                properties:
                  email:
                    type: string
                  status:
                    type: string
                    enum:
                    - CREATED
                    - UPDATED
                    - NO_CHANGE
                    - FAILED
    Contact:
      type: object
      properties:
        id:
          type: string
          example: 0001760c4a86bc38a4a60bcceae32540
        email:
          type: string
          format: email
        properties:
          $ref: '#/components/schemas/ContactProperties'
    Envelope:
      type: object
      properties:
        data:
          description: Payload — object or array, shape depends on the endpoint.
        pagination:
          type: object
          description: Present only on paged list endpoints.
          properties:
            pageNumber:
              type: integer
              example: 1
            pageSize:
              type: integer
              example: 20
            totalElements:
              type: integer
              example: 151
            totalPages:
              type: integer
              example: 8
        errors:
          type: array
          items:
            type: object
            properties:
              errorCode:
                type: string
              message:
                type: string
              detail:
                type: string
        meta:
          type: object
          properties:
            status:
              type: string
              enum:
              - SUCCESS
              - FAILURE
            timestamp:
              type: string
              format: date-time
    ContactProperties:
      type: object
      description: Keys must be snake_case. camelCase keys are silently ignored (saved as null).
      properties:
        first_name:
          type: string
        last_name:
          type: string
        company_name:
          type: string
        _source:
          type: string
          description: Set by Inflection to identify the write source.
      additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Personal Access Token. READ scope for GET, WRITE scope for POST/PATCH/DELETE.