openapi: 3.0.3
info:
  title: TalkToHumans Public API
  version: "1.0.0"
  license:
    name: Proprietary
  description: |
    Read and organize the LinkedIn organization data your team already manages in TalkToHumans: accounts, contacts, signals, content, tags, notes, custom fields, sequence state, conversations, templates, and views.
servers:
  - url: https://api.talktohumans.app
    description: TalkToHumans API
security:
  - bearerAuth: []
tags:
  - name: Organization
    description: Organization details for the current API key.
  - name: LinkedIn
    description: LinkedIn accounts, contacts, companies, and conversations.
  - name: Activity
    description: Activity for organization reporting.
  - name: Enrich
    description: Profile enrichment for LinkedIn contacts and companies.
  - name: Views
    description: Saved TalkToHumans views.
  - name: Sequences
    description: Sequences of contacts and conversations.
  - name: Templates
    description: Message and sequence templates.
  - name: Custom fields
    description: Custom fields for contacts and companies.
  - name: Tags
    description: Tags for contacts and companies.
  - name: Content
    description: LinkedIn posts and comments, and the people who engage with them.
  - name: Agents
    description: Playbooks and feedback for AI agents, shared with the MCP.
paths:
  /v1/organization:
    get:
      tags:
        - Organization
      x-mint:
        href: /developers/accounts/get-organization
      operationId: getOrganization
      summary: Get organization
      description: Returns metadata about the current organization
      responses:
        "200":
          description: Organization metadata.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetOrganizationEnvelope"
              example:
                data:
                  organization:
                    id: 123
                    name: Acme
                    created_at: "2026-05-10T12:00:00Z"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/credits:
    get:
      tags:
        - Organization
      x-mint:
        href: /developers/accounts/get-credit-balance
      operationId: getCreditBalance
      summary: Get credit balance
      description: Returns the organization's credits for the current billing period, what each action costs, and its plan
      responses:
        "200":
          description: Credit balance.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreditBalanceEnvelope"
              example:
                data:
                  credit_balance:
                    available_credits: 680
                    used_credits: 320
                    total_credits: 1000
                    period_start: "2026-10-01T00:00:00Z"
                    period_end: "2026-11-01T00:00:00Z"
                  plan:
                    name: Pro
                    trial_ends_at: "2026-11-01T00:00:00Z"
                    payment_past_due: false
                    action_url: https://app.talktohumans.app/?settings=usage
                  credit_costs:
                    profile_enrichment: 2
                    profile_content: 2
                    content_post: 1
                    content_engagers_per_100: 2
                    people_search_page: 10
                    post_search_page: 2
                    job_search_page: 5
                    work_email_found: 12
                    mobile_phone_found: 120
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "409":
          description: The organization has no subscription with credits.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                code: conflict
                message: credit balance is not available for this workspace
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/accounts:
    get:
      tags:
        - LinkedIn
      x-mint:
        href: /developers/accounts/list-accounts
      operationId: listAccounts
      summary: List connected accounts
      description: Lists connected LinkedIn accounts and the user's own profile
      responses:
        "200":
          description: Connected LinkedIn accounts.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListAccountsEnvelope"
              example:
                data:
                  accounts:
                    - account_id: "42"
                      display_name: Jane Doe
                      provider_account_id: ACoAA000000
                      owner_user_id: "7"
                      contact_id: "1234"
                      sync:
                        status: fresh
                        last_synced_at: "2026-10-15T03:30:00Z"
                        inbox:
                          last_synced_at: "2026-10-15T08:28:00Z"
                          next_sync_by: "2026-10-15T08:32:30Z"
                          fully_loaded: true
                        invitations:
                          last_synced_at: "2026-10-15T06:10:00Z"
                          next_sync_by: "2026-10-15T14:10:00Z"
                          fully_loaded: true
                        sent_invitations:
                          last_synced_at: "2026-10-15T03:30:00Z"
                          next_sync_by: "2026-10-15T11:30:00Z"
                          fully_loaded: true
                        connections:
                          last_synced_at: "2026-10-15T05:00:00Z"
                          next_sync_by: "2026-10-15T19:00:00Z"
                          fully_loaded: false
                      premium:
                        status: premium
                        checked_at: "2026-10-15T07:45:00Z"
                      sales_navigator:
                        status: active
                        inmail_credits: 48
                        checked_at: "2026-10-15T07:45:00Z"
                      profile:
                        name: Jane Doe
                        headline: Founder at Acme · Helping B2B teams sell on LinkedIn
                        primary_role_title: Founder
                        primary_company_name: Acme
                        linkedin_url: https://www.linkedin.com/in/janedoe
                        about: I help B2B teams turn LinkedIn into a pipeline.
                        follower_count: 4210
                        connections_count: 2876
                        languages:
                          - language: English
                        experiences:
                          - experience_id: "301"
                            company_name: Acme
                            title: Founder
                            start_at: "2024-03"
                            is_current: true
                        educations:
                          - education_id: "401"
                            school_name: HEC Paris
                            degree: MSc
                            end_at: "2018"
                        locations:
                          - display_text: Paris, France
                            is_primary: true
                            is_headquarter: false
                        fetched_at: "2026-10-01T09:30:00Z"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/activity:
    get:
      tags:
        - Activity
      x-mint:
        href: /developers/activity/list-activity
      operationId: listActivity
      summary: List activity
      description: Lists activity events for the current organization
      parameters:
        - $ref: "#/components/parameters/ActivityFrom"
        - $ref: "#/components/parameters/ActivityTo"
        - $ref: "#/components/parameters/ActivityTimezone"
        - $ref: "#/components/parameters/ActivityAccountId"
        - $ref: "#/components/parameters/ActivityUserId"
        - $ref: "#/components/parameters/ActivityEventType"
        - $ref: "#/components/parameters/ActivityChannel"
        - $ref: "#/components/parameters/ActivitySource"
        - $ref: "#/components/parameters/ActivityTag"
        - $ref: "#/components/parameters/ActivityLimit"
        - $ref: "#/components/parameters/ActivityCursor"
      responses:
        "200":
          description: Activity rows.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListActivityEnvelope"
              example:
                data:
                  generated_at: "2026-07-09T12:00:00Z"
                  timezone: America/Los_Angeles
                  filters:
                    from: "2026-07-01T07:00:00Z"
                    to: "2026-07-10T07:00:00Z"
                    to_exclusive: true
                    account_ids:
                      - "42"
                    event_types:
                      - message_sent
                      - outbound_reply_received
                    channels:
                      - linkedin_message
                    sources:
                      - canonical_messages
                    tag_attribution: unavailable
                  activity:
                    - id: "987"
                      occurred_at: "2026-07-09T10:30:00Z"
                      recorded_at: "2026-07-09T10:30:04Z"
                      event_type: message_sent
                      source: canonical_messages
                      channel: linkedin_message
                      user_id: "7"
                      account_id: "42"
                      subject_key: linkedin:participant:linkedin:urn:li:fsd_profile:abc
                      attribution_method: user_and_account
                      metadata:
                        provider_message_id: urn:li:msg:abc
                        provider_chat_id: urn:li:msg_conversation:def
                        message_source: linkedin_message
                  pagination:
                    limit: 50
                    has_more: false
                  caveats:
                    - "Account 42 (Jane Doe): inbox last synced 2026-07-08T18:00:00Z, so messages sent or received on LinkedIn after that may be missing."
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/AdminForbidden"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/activity/summary:
    get:
      tags:
        - Activity
      x-mint:
        href: /developers/activity/summarize-activity
      operationId: summarizeActivity
      summary: Summarize activity
      description: Summarizes LinkedIn activity and performance for the current organization
      parameters:
        - $ref: "#/components/parameters/ActivityFrom"
        - $ref: "#/components/parameters/ActivityTo"
        - $ref: "#/components/parameters/ActivityTimezone"
        - $ref: "#/components/parameters/ActivityAccountId"
        - $ref: "#/components/parameters/ActivityUserId"
        - $ref: "#/components/parameters/ActivityEventType"
        - $ref: "#/components/parameters/ActivityChannel"
        - $ref: "#/components/parameters/ActivitySource"
        - $ref: "#/components/parameters/ActivityTag"
      responses:
        "200":
          description: Activity summary.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ActivitySummaryEnvelope"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/AdminForbidden"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/enrich:
    post:
      tags:
        - Enrich
      x-mint:
        href: /developers/enrich/enrich-profile
      operationId: enrichProfile
      summary: Enrich profile
      description: Enriches a LinkedIn profile and its primary company
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EnrichProfileRequest"
            examples:
              linkedinUrl:
                summary: Enrich by LinkedIn URL
                value:
                  account_id: "42"
                  linkedin_url: https://www.linkedin.com/in/jane-doe/
              contactId:
                summary: Enrich an existing contact
                value:
                  account_id: "42"
                  contact_id: "123"
      responses:
        "200":
          description: LinkedIn profile and primary company enrichment data.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EnrichProfileEnvelope"
              example:
                data:
                  linkedin_enrichment:
                    profile:
                      participant:
                        provider: linkedin
                        provider_participant_id: urn:li:fsd_profile:abc
                        kind: member
                        public_identifier: jane-doe
                        profile_url: https://www.linkedin.com/in/jane-doe/
                        first_name: Jane
                        last_name: Doe
                        full_name: Jane Doe
                        headline: Founder at Acme
                        avatar_url: https://media.licdn.com/dms/image/example/profile-displayphoto.jpg
                        background_cover_url: https://media.licdn.com/dms/image/example/profile-cover.jpg
                        primary_company:
                          provider: linkedin
                          provider_participant_id: urn:li:fsd_company:123
                        primary_company_name: Acme
                        primary_role_title: Founder
                        profile_fetched_at: "2026-05-31T12:00:00Z"
                        updated_at: "2026-05-31T12:00:00Z"
                      languages:
                        - language: English
                          metadata_json: null
                      experiences:
                        - company:
                            provider: linkedin
                            provider_participant_id: urn:li:fsd_company:123
                          company_name: Acme
                          title: Founder
                          employment_type: Full-time
                          location: San Francisco Bay Area
                          start_at: "2021-01"
                          end_at: null
                          is_current: true
                          description: Building business software for sales teams.
                          metadata_json: null
                      educations:
                        - school:
                            provider: linkedin
                            provider_participant_id: urn:li:fsd_company:987
                          school_name: Stanford University
                          degree: MBA
                          field_of_study: Business Administration
                          start_at: "2014"
                          end_at: "2016"
                          description: null
                          metadata_json: null
                      locations:
                        - source: linkedin
                          sort_order: 0
                          is_primary: true
                          is_headquarter: false
                          linkedin_text: San Francisco Bay Area
                          display_text: San Francisco, California, United States
                          country_code: US
                          region_code: US-CA
                          country: United States
                          country_full: United States
                          state: California
                          city: San Francisco
                          geographic_area: San Francisco Bay Area
                          line1: null
                          line2: null
                          postal_code: null
                          description: null
                          metadata_json: null
                      industries:
                        - sort_order: 0
                          industry_urn: urn:li:industry:4
                          provider_industry_id: "4"
                          name: Software Development
                          title: Software Development
                          hierarchy: Technology > Software
                          metadata_json: null
                    company:
                      participant:
                        provider: linkedin
                        provider_participant_id: urn:li:fsd_company:123
                        kind: company
                        public_identifier: acme
                        profile_url: https://www.linkedin.com/company/acme/
                        full_name: Acme
                        headline: Software Development
                        avatar_url: https://media.licdn.com/dms/image/example/company-logo.jpg
                        background_cover_url: https://media.licdn.com/dms/image/example/company-cover.jpg
                        headcount: 51-200
                        employee_count: 120
                        website_url: https://acme.example
                        follower_count: 12000
                        about: Acme builds business software.
                        profile_fetched_at: "2026-05-31T12:00:00Z"
                        updated_at: "2026-05-31T12:00:00Z"
                      languages:
                        - language: English
                          metadata_json: null
                      experiences:
                        - company: null
                          company_name: Acme
                          title: Company profile
                          employment_type: null
                          location: San Francisco, CA
                          start_at: null
                          end_at: null
                          is_current: true
                          description: null
                          metadata_json: null
                      educations:
                        - school: null
                          school_name: null
                          degree: null
                          field_of_study: null
                          start_at: null
                          end_at: null
                          description: null
                          metadata_json: null
                      locations:
                        - source: linkedin
                          sort_order: 0
                          is_primary: true
                          is_headquarter: true
                          linkedin_text: San Francisco, CA
                          display_text: San Francisco, California, United States
                          country_code: US
                          region_code: US-CA
                          country: United States
                          country_full: United States
                          state: California
                          city: San Francisco
                          geographic_area: San Francisco Bay Area
                          line1: null
                          line2: null
                          postal_code: null
                          description: null
                          metadata_json: null
                      industries:
                        - sort_order: 0
                          industry_urn: urn:li:industry:4
                          provider_industry_id: "4"
                          name: Software Development
                          title: Software Development
                          hierarchy: Technology > Software
                          metadata_json: null
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "402":
          $ref: "#/components/responses/InsufficientCredits"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "404":
          $ref: "#/components/responses/ProfileNotFound"
        "409":
          $ref: "#/components/responses/EnrichmentInProgress"
        "429":
          $ref: "#/components/responses/RateLimited"
        "502":
          $ref: "#/components/responses/EnrichmentFailed"
        "504":
          $ref: "#/components/responses/EnrichmentTimeout"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/contacts:
    post:
      tags:
        - LinkedIn
      x-mint:
        href: /developers/contacts/import-contact
      operationId: importContacts
      summary: Import contacts
      description: Imports one or multiple contacts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ImportContactsRequest"
            example:
              account_id: "42"
              linkedin_urls:
                - https://www.linkedin.com/in/jane-doe/
                - https://www.linkedin.com/in/john-smith/
      responses:
        "202":
          description: Import started. Profiles are imported in the background.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ContactImportEnvelope"
              example:
                data:
                  import:
                    import_id: 3f6c1a2e-8d4b-4c5a-9e7f-1b2d3c4e5f60
                    status: running
                    account:
                      account_id: "42"
                      display_name: Jane Doe
                      provider_account_id: ACoAA000000
                      owner_user_id: "7"
                    counts:
                      total: 2
                      pending: 2
                      imported: 0
                      already_present: 0
                      failed: 0
                    results:
                      - linkedin_url: https://www.linkedin.com/in/jane-doe/
                        status: pending
                      - linkedin_url: https://www.linkedin.com/in/john-smith/
                        status: pending
                    warnings: []
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "402":
          $ref: "#/components/responses/InsufficientCredits"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
    get:
      tags:
        - LinkedIn
      x-mint:
        href: /developers/contacts/list-contacts
      operationId: listContacts
      summary: List contacts
      description: Lists LinkedIn contacts
      parameters:
        - $ref: "#/components/parameters/AccountId"
        - name: contact_id
          in: query
          description: Filter by contact ID, including email and phone lookup results.
          schema:
            type: string
            pattern: "^[1-9][0-9]*$"
        - name: query
          in: query
          description: Search by name, headline, company, role, about, experiences, notes, LinkedIn handle, or profile URL.
          schema:
            type: string
        - name: provider_participant_id
          in: query
          description: Return the contact with this exact LinkedIn provider participant ID, such as `urn:li:fsd_profile:abc`. TalkToHumans contacts page URLs carry it as their `contact` query parameter.
          schema:
            type: string
        - name: conversation_id
          in: query
          description: Return contacts who participate in the given TalkToHumans conversation.
          schema:
            type: string
        - name: view_id
          in: query
          description: |
            Filter by a saved contact view. Accepts the view `id` or an unambiguous `public_id` from `GET /v1/views`.
            Uses the view's account and filters. An explicit `account_id` scope must include that account.
            Results keep the endpoint's normal ordering.
          schema:
            type: string
        - name: filters
          in: query
          description: |
            JSON array of filters contacts must all match, in the same shape as a view's `filters`.
            Field keys name their record, such as `member.full_name`, `company.industry`, or `conversation.reply_state`. Custom fields use `member.custom_fields.<name>`.
            To find contacts by LinkedIn URL, filter `member.linkedin_url` `=` with a list of URLs.
            Requires exactly one account: pass one `account_id` when several are accessible.
          schema:
            type: string
          example: '[{"field":"member.tags","operator":"contains","value":["Hot lead"]},{"field":"member.custom_fields.ICP score","operator":">=","value":80}]'
        - name: sorts
          in: query
          description: |
            JSON array of sorts, first entry first, in the same shape as a view's `sorts`.
            Requires exactly one account. Pages still follow `cursor`.
          schema:
            type: string
          example: '[{"field":"member.connected_at","direction":"desc"}]'
        - $ref: "#/components/parameters/Limit"
        - $ref: "#/components/parameters/Cursor"
      responses:
        "200":
          description: Contacts matching the filters.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListContactsEnvelope"
              example:
                data:
                  contacts:
                    - account_relationship_id: "1042"
                      contact_enrichment:
                        work_email:
                          status: found
                        phone:
                          status: found
                      contact_id: "123"
                      provider_participant_id: urn:li:fsd_profile:abc
                      public_identifier: jane-doe
                      account:
                        account_id: "42"
                        display_name: Jane Doe
                        provider_account_id: ACoAA000000
                        owner_user_id: "7"
                      name: Jane Doe
                      first_name: Jane
                      last_name: Doe
                      headline: Founder at Acme
                      primary_role_title: Founder
                      primary_company_name: Acme
                      work_email: jane@acme.example
                      phone: "+14155550123"
                      linkedin_url: https://www.linkedin.com/in/jane-doe/
                      avatar_url: https://media.licdn.com/dms/image/example/profile-displayphoto.jpg
                      background_cover_url: https://media.licdn.com/dms/image/example/profile-cover.jpg
                      relationship_status: connected
                      "Deal stage": Qualified
                      "Lead score": 91
                      "Next follow-up": "2026-07-01"
                      VIP: true
                      tags:
                        - name: Hot lead
                          color: red
                      notes:
                        - note_id: 0b7e4c2a-5d1f-4a8e-9c3b-6f2d1e0a9b8c
                          content: Follow up next week
                          created_at: "2026-06-24T09:15:00Z"
                      languages:
                        - language: English
                      experiences:
                        - experience_id: exp_2f8c1b
                          company_participant_id: linkedin:participant:urn:li:fsd_company:123
                          company_provider_participant_id: urn:li:fsd_company:123
                          company_name: Acme
                          title: Founder
                          employment_type: Full-time
                          location: San Francisco Bay Area
                          start_at: "2021-01"
                          is_current: true
                          description: Building business software for sales teams.
                      educations:
                        - education_id: edu_91ac42
                          school_participant_id: linkedin:participant:urn:li:fsd_company:987
                          school_provider_participant_id: urn:li:fsd_company:987
                          school_name: Stanford University
                          degree: MBA
                          field_of_study: Business Administration
                          start_at: "2014"
                          end_at: "2016"
                      locations:
                        - linkedin_text: San Francisco Bay Area
                          display_text: San Francisco, California, United States
                          country_code: US
                          region_code: US-CA
                          country: United States
                          country_full: United States
                          state: California
                          city: San Francisco
                          geographic_area: San Francisco Bay Area
                          is_primary: true
                          is_headquarter: false
                      company:
                        company_id: linkedin:participant:urn:li:fsd_company:123
                        provider_participant_id: urn:li:fsd_company:123
                        public_identifier: acme
                        name: Acme
                        linkedin_url: https://www.linkedin.com/company/acme/
                        avatar_url: https://media.licdn.com/dms/image/example/company-logo.jpg
                        background_cover_url: https://media.licdn.com/dms/image/example/company-cover.jpg
                        headline: Software Development
                        headcount: 51-200
                        employee_count: 120
                        website_url: https://acme.example
                        follower_count: 12000
                        about: Acme builds business software.
                        industries:
                          - name: Software Development
                            title: Software Development
                            industry_urn: urn:li:industry:4
                            provider_industry_id: "4"
                            hierarchy: Technology > Software
                        locations:
                          - linkedin_text: San Francisco, CA
                            display_text: San Francisco, California, United States
                            country_code: US
                            region_code: US-CA
                            country: United States
                            country_full: United States
                            state: California
                            city: San Francisco
                            geographic_area: San Francisco Bay Area
                            is_primary: true
                            is_headquarter: true
                        app_url: https://app.talktohumans.app/companies?company=urn%3Ali%3Afsd_company%3A123
                      app_url: https://app.talktohumans.app/new?participantIds=linkedin%3Aparticipant%3Aurn%3Ali%3Afsd_profile%3Aabc
                  pagination:
                    limit: 10
                    has_more: false
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/LinkedInNotConnected"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/contacts/delete:
    post:
      tags:
        - LinkedIn
      x-mint:
        href: /developers/contacts/delete-contacts
      operationId: deleteContacts
      summary: Delete contacts
      description: Deletes one or multiple contacts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DeleteContactsRequest"
            example:
              account_id: "42"
              contact_ids:
                - "1201"
                - "1202"
      responses:
        "200":
          description: Contacts deleted. Contacts that can't be deleted are listed in `skipped`.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeleteContactsEnvelope"
              example:
                data:
                  deleted:
                    - "1201"
                  skipped:
                    - contact_id: "1202"
                      reason: connected
                      message: Connected on LinkedIn
                  deleted_sequences: 0
                  deleted_drafts: 0
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/contacts/imports/{import_id}:
    get:
      tags:
        - LinkedIn
      x-mint:
        href: /developers/contacts/get-import-progress
      operationId: getContactImport
      summary: Get import progress
      description: Gets the progress and results of a contact or engager import
      parameters:
        - name: import_id
          in: path
          required: true
          description: Import ID returned by `POST /v1/contacts` or `POST /v1/content/engagers/import`.
          schema:
            type: string
      responses:
        "200":
          description: Import progress and per-profile results.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ContactImportEnvelope"
              example:
                data:
                  import:
                    import_id: 3f6c1a2e-8d4b-4c5a-9e7f-1b2d3c4e5f60
                    status: completed
                    account:
                      account_id: "42"
                      display_name: Jane Doe
                      provider_account_id: ACoAA000000
                      owner_user_id: "7"
                    counts:
                      total: 3
                      pending: 0
                      imported: 1
                      already_present: 1
                      failed: 1
                    results:
                      - linkedin_url: https://www.linkedin.com/in/jane-doe/
                        status: imported
                        contact_id: "123"
                        app_url: https://app.talktohumans.app/new?participantIds=linkedin%3Aparticipant%3Aurn%3Ali%3Afsd_profile%3Aabc
                      - linkedin_url: https://www.linkedin.com/in/john-smith/
                        status: already_present
                        contact_id: "456"
                        app_url: https://app.talktohumans.app/new?participantIds=linkedin%3Aparticipant%3Aurn%3Ali%3Afsd_profile%3Adef
                      - linkedin_url: https://www.linkedin.com/in/private-profile/
                        status: failed
                        error:
                          code: linkedin_profile_not_found
                          message: LinkedIn profile not found or not publicly available
                    warnings: []
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/contacts/{contact_id}/find-email:
    post:
      tags:
        - Enrich
      x-mint:
        href: /developers/enrich/find-email
      operationId: findContactEmail
      summary: Find email
      description: Finds a LinkedIn contact's work email
      parameters:
        - name: contact_id
          in: path
          required: true
          description: Contact ID returned by `GET /v1/contacts` or a contact import's results.
          schema:
            type: string
            pattern: "^[1-9][0-9]*$"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/FindContactInfoRequest"
            example:
              account_id: "42"
      responses:
        "200":
          description: Contact with the lookup result.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FindContactInfoEnvelope"
        "202":
          description: Lookup in progress. Check `contact_enrichment.work_email.status` with `GET /v1/contacts?contact_id={contact_id}&account_id={account_id}` in about a minute; lookups usually take 1 to 5 minutes.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FindContactInfoEnvelope"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "402":
          $ref: "#/components/responses/InsufficientCredits"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/contacts/{contact_id}/find-phone:
    post:
      tags:
        - Enrich
      x-mint:
        href: /developers/enrich/find-phone
      operationId: findContactPhone
      summary: Find phone
      description: Finds a LinkedIn contact's mobile phone number
      parameters:
        - name: contact_id
          in: path
          required: true
          description: Contact ID returned by `GET /v1/contacts` or a contact import's results.
          schema:
            type: string
            pattern: "^[1-9][0-9]*$"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/FindContactInfoRequest"
            example:
              account_id: "42"
      responses:
        "200":
          description: Contact with the lookup result.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FindContactInfoEnvelope"
        "202":
          description: Lookup in progress. Check `contact_enrichment.phone.status` with `GET /v1/contacts?contact_id={contact_id}&account_id={account_id}` in about a minute; lookups usually take 1 to 5 minutes.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FindContactInfoEnvelope"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "402":
          $ref: "#/components/responses/InsufficientCredits"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/contacts/{contact_id}/find-content:
    post:
      tags:
        - Content
      x-mint:
        href: /developers/content/find-content
      operationId: findContactContent
      summary: Find content
      description: Finds a LinkedIn contact's recent posts and comments
      parameters:
        - name: contact_id
          in: path
          required: true
          description: Contact ID returned by `GET /v1/contacts`, or the account's own `contact_id` from `GET /v1/accounts` for the user's own posts and comments.
          schema:
            type: string
            pattern: "^[1-9][0-9]*$"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/FindContentRequest"
            example:
              account_id: "42"
      responses:
        "200":
          description: |
            How many posts and comments were found. Read them with `GET /v1/content?contact_id={contact_id}&account_id={account_id}`.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FindContentEnvelope"
              example:
                data:
                  contact_id: "123"
                  account:
                    account_id: "42"
                    display_name: Jane Doe
                    provider_account_id: ACoAA000000
                    owner_user_id: "7"
                  post_count: 12
                  comment_count: 40
                  charged_credits: 2
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "402":
          $ref: "#/components/responses/InsufficientCredits"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        "502":
          $ref: "#/components/responses/RequestFailed"
        "504":
          $ref: "#/components/responses/RequestTimeout"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/contacts/{contact_id}/track-content:
    post:
      tags:
        - Content
      x-mint:
        href: /developers/content/track-content
      operationId: trackContactContent
      summary: Track content
      description: Checks a LinkedIn contact's posts every day
      parameters:
        - name: contact_id
          in: path
          required: true
          description: Contact ID returned by `GET /v1/contacts`. The user's own posts are tracked by the "Track my posts" setting instead.
          schema:
            type: string
            pattern: "^[1-9][0-9]*$"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TrackContentRequest"
            examples:
              start:
                summary: Start tracking
                value:
                  account_id: "42"
              stop:
                summary: Stop tracking
                value:
                  account_id: "42"
                  enabled: false
      responses:
        "200":
          description: |
            The contact's tracking. Starting it runs the first check now, then one every day, until it is stopped. Read the engagers with `GET /v1/contacts?view_id={engagers_view_id}`.
            Asking for the state it is already in changes nothing.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TrackContentEnvelope"
              example:
                data:
                  contact_id: "123"
                  account:
                    account_id: "42"
                    display_name: Jane Doe
                    provider_account_id: ACoAA000000
                    owner_user_id: "7"
                  content_tracking:
                    enabled: true
                    engagers_view_id: view_0f8fad5bd9cb469fa16570867728950e
                    last_checked_at: null
                    last_check_error: null
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "402":
          $ref: "#/components/responses/InsufficientCredits"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/contacts/{contact_id}:
    patch:
      tags:
        - LinkedIn
      x-mint:
        href: /developers/contacts/update-contact
      operationId: updateContact
      summary: Update contact
      description: Updates a LinkedIn contact
      parameters:
        - name: contact_id
          in: path
          required: true
          description: Contact ID returned by `GET /v1/contacts`.
          schema:
            type: string
            pattern: "^[1-9][0-9]*$"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateContactRequest"
            examples:
              addRemoveTags:
                summary: Add and remove tags
                value:
                  account_id: "42"
                  tags:
                    add:
                      - name: Hot lead
                        color: red
                    remove:
                      - Old tag
              setTags:
                summary: Replace tags
                value:
                  account_id: "42"
                  tags:
                    set:
                      - name: Customer
                        color: green
              addRemoveNotes:
                summary: Add and remove notes
                value:
                  account_id: "42"
                  notes:
                    add:
                      - content: Follow up next week
                    remove:
                      - 9a1d3f5e-2b4c-4d6e-8f0a-1c3e5b7d9f2a
              clearNotes:
                summary: Clear notes
                value:
                  account_id: "42"
                  notes:
                    set: []
              setCustomFields:
                summary: Set custom fields
                description: Each custom field key is the field's registered name.
                value:
                  account_id: "42"
                  "Deal stage": Qualified
                  "Lead score": 91
                  "Next follow-up": "2026-07-01"
                  VIP: true
              clearCustomField:
                summary: Clear a custom field
                value:
                  account_id: "42"
                  "Next follow-up": null
      responses:
        "200":
          description: Contact updated.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UpdateContactEnvelope"
              example:
                data:
                  contact:
                    contact_id: "123"
                    account:
                      account_id: "42"
                      display_name: Jane Doe
                      provider_account_id: ACoAA000000
                      owner_user_id: "7"
                    name: Jane Doe
                    first_name: Jane
                    last_name: Doe
                    headline: Founder at Acme
                    primary_role_title: Founder
                    primary_company_name: Acme
                    linkedin_url: https://www.linkedin.com/in/jane-doe/
                    relationship_status: connected
                    work_email: jane@acme.example
                    phone: "+14155550123"
                    contact_enrichment:
                      work_email:
                        status: found
                      phone:
                        status: found
                    tags:
                      - name: Hot lead
                        color: red
                    notes:
                      - note_id: 0b7e4c2a-5d1f-4a8e-9c3b-6f2d1e0a9b8c
                        content: Follow up next week
                        created_at: "2026-06-24T09:15:00Z"
                    app_url: https://app.talktohumans.app/new?participantIds=linkedin%3Aparticipant%3Aurn%3Ali%3Afsd_profile%3Aabc
                    "Deal stage": Qualified
                    "Lead score": 91
                    "Next follow-up": "2026-07-01"
                    VIP: true
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/people/search:
    post:
      tags:
        - LinkedIn
      x-mint:
        href: /developers/contacts/search-people
      operationId: searchPeople
      summary: Search people
      description: Finds new people on LinkedIn
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SearchPeopleRequest"
            example:
              job_titles:
                - Head of Sales
                - VP Sales
              locations:
                - Paris
              industries:
                - Software Development
              company_sizes:
                - 11-50
                - 51-200
      responses:
        "200":
          description: |
            One page of 25 people. They aren't contacts yet: import them with `POST /v1/contacts` and their `linkedin_url`.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SearchPeopleEnvelope"
              example:
                data:
                  people:
                    - name: Alex Nguyen
                      first_name: Alex
                      last_name: Nguyen
                      primary_role_title: Head of Sales
                      primary_company_name: Example Co
                      primary_company_linkedin_url: https://www.linkedin.com/company/1000050
                      primary_company_industry: Software Development
                      location: Paris, Île-de-France, France
                      linkedin_url: https://www.linkedin.com/in/ACwAAA0000000000000000000000000000000000
                  total_results: 2537
                  pagination:
                    limit: 25
                    has_more: true
                    next_cursor: eyJxdWVyeV9rZXkiOiIuLi4iLCJwYWdlIjoyfQ
                  charged_credits: 10
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "402":
          $ref: "#/components/responses/InsufficientCredits"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "429":
          $ref: "#/components/responses/RateLimited"
        "502":
          $ref: "#/components/responses/RequestFailed"
        "504":
          $ref: "#/components/responses/RequestTimeout"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/jobs/search:
    post:
      tags:
        - LinkedIn
      x-mint:
        href: /developers/companies/search-jobs
      operationId: searchJobs
      summary: Search jobs
      description: Finds LinkedIn job posts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SearchJobsRequest"
            example:
              keywords: Sales Development Representative
              location: France
              posted_within: month
      responses:
        "200":
          description: |
            One page of up to 25 jobs, each with its description. Jobs aren't saved in TalkToHumans: find who to contact at a hiring company with `POST /v1/people/search` and its `company_linkedin_url`, and push a job worth acting on as a signal with `POST /v1/signals`.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SearchJobsEnvelope"
              example:
                data:
                  jobs:
                    - title: Sales Development Representative
                      linkedin_url: https://www.linkedin.com/jobs/view/4000000001
                      company_name: Example Co
                      company_linkedin_url: https://www.linkedin.com/company/example-co
                      location: Paris, Île-de-France, France (Hybrid)
                      posted_at: "2026-11-20T09:00:00Z"
                      employment_type: full_time
                      workplace_type: hybrid
                      applicant_count: 25
                      description: You'll build our LinkedIn outbound from scratch and book meetings for the founders.
                  total_results: 249
                  pagination:
                    limit: 25
                    has_more: true
                    next_cursor: eyJxdWVyeV9rZXkiOiIuLi4iLCJwYWdlIjoyfQ
                  charged_credits: 5
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "402":
          $ref: "#/components/responses/InsufficientCredits"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "429":
          $ref: "#/components/responses/RateLimited"
        "502":
          $ref: "#/components/responses/RequestFailed"
        "504":
          $ref: "#/components/responses/RequestTimeout"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/companies:
    get:
      tags:
        - LinkedIn
      x-mint:
        href: /developers/companies/list-companies
      operationId: listCompanies
      summary: List companies
      description: Lists LinkedIn companies
      parameters:
        - $ref: "#/components/parameters/AccountId"
        - name: query
          in: query
          description: Search by company name, tagline, public identifier, or LinkedIn URL.
          schema:
            type: string
        - name: view_id
          in: query
          description: |
            Filter by a saved company view. Accepts the view `id` or an unambiguous `public_id` from `GET /v1/views`.
            Uses the view's account and filters. An explicit `account_id` scope must include that account.
            Results keep the endpoint's normal ordering.
          schema:
            type: string
        - name: filters
          in: query
          description: |
            JSON array of filters companies must all match, in the same shape as a company view's `filters`.
            Field keys name their record, such as `company.employee_count` or `member.full_name`. Custom fields use `company.custom_fields.<name>`.
            Requires exactly one account: pass one `account_id` when several are accessible.
          schema:
            type: string
          example: '[{"field":"company.tags","operator":"contains","value":["Target account"]},{"field":"company.employee_count","operator":">=","value":50}]'
        - name: sorts
          in: query
          description: |
            JSON array of sorts, first entry first, in the same shape as a company view's `sorts`.
            Requires exactly one account. Pages still follow `cursor`.
          schema:
            type: string
          example: '[{"field":"company.employee_count","direction":"desc"}]'
        - $ref: "#/components/parameters/Limit"
        - $ref: "#/components/parameters/Cursor"
      responses:
        "200":
          description: Companies matching the filters.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListCompaniesEnvelope"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/LinkedInNotConnected"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/companies/{company_id}:
    patch:
      tags:
        - LinkedIn
      x-mint:
        href: /developers/companies/update-company
      operationId: updateCompany
      summary: Update company
      description: Updates a LinkedIn company
      parameters:
        - name: company_id
          in: path
          required: true
          description: Company ID returned by `GET /v1/companies` (the `company_id` field).
          schema:
            type: string
            pattern: "^[1-9][0-9]*$"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateCompanyRequest"
            examples:
              setCustomFields:
                summary: Set custom fields
                description: Each custom field key is the field's registered name.
                value:
                  account_id: "42"
                  "Deal stage": Negotiation
                  ARR: 50000
              setTags:
                summary: Replace tags
                value:
                  account_id: "42"
                  tags:
                    set:
                      - name: Target account
                        color: green
              addNote:
                summary: Add a note
                value:
                  account_id: "42"
                  notes:
                    add:
                      - content: Renewal discussion planned for Q3
              clearNotes:
                summary: Clear notes
                value:
                  account_id: "42"
                  notes:
                    set: []
      responses:
        "200":
          description: Company updated.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UpdateCompanyEnvelope"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/custom-fields:
    get:
      tags:
        - Custom fields
      x-mint:
        href: /developers/custom-fields/list-custom-fields
      operationId: listCustomFields
      summary: List custom fields
      description: Lists custom fields for contacts or companies
      parameters:
        - name: object_type
          in: query
          description: Object the fields belong to. Defaults to contact.
          schema:
            type: string
            enum: [contact, company]
            default: contact
      responses:
        "200":
          description: Custom fields.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListCustomFieldsEnvelope"
              example:
                data:
                  custom_fields:
                    - id: 8f3a2c1d4b5e4f6a9b7c0d1e2f3a4b5c
                      name: ICP score
                      field_type: number
                      object_type: contact
                    - id: 1b2c3d4e5f6a4b7c8d9e0f1a2b3c4d5e
                      name: Deal stage
                      field_type: text
                      object_type: contact
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
    post:
      tags:
        - Custom fields
      x-mint:
        href: /developers/custom-fields/create-custom-field
      operationId: createCustomField
      summary: Create custom field
      description: Creates a custom field for contacts or companies
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateCustomFieldRequest"
            examples:
              contact:
                summary: Create a contact field
                value:
                  name: ICP score
                  field_type: number
              company:
                summary: Create a company field
                value:
                  name: Target account
                  field_type: boolean
                  object_type: company
      responses:
        "201":
          description: Custom field created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustomFieldEnvelope"
              example:
                data:
                  custom_field:
                    id: 8f3a2c1d4b5e4f6a9b7c0d1e2f3a4b5c
                    name: ICP score
                    field_type: number
                    object_type: contact
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/AdminForbidden"
        "409":
          $ref: "#/components/responses/Conflict"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/tags:
    get:
      tags:
        - Tags
      x-mint:
        href: /developers/tags/list-tags
      operationId: listTags
      summary: List tags
      description: Lists tags for contacts or companies
      parameters:
        - name: object_type
          in: query
          description: Object the tags belong to. Defaults to contact.
          schema:
            type: string
            enum: [contact, company]
            default: contact
      responses:
        "200":
          description: Tags.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListTagsEnvelope"
              example:
                data:
                  tags:
                    - id: 3c9e1f2a7b4d4e8f9a0b1c2d3e4f5a6b
                      name: Hot lead
                      color: red
                      object_type: contact
                    - id: 7d2a4b6c8e0f4a1b3c5d7e9f0a2b4c6d
                      name: Investor
                      color: purple
                      object_type: contact
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/tags/{tag_id}:
    patch:
      tags:
        - Tags
      x-mint:
        href: /developers/tags/update-tag
      operationId: updateTag
      summary: Update tag
      description: Renames or recolors a tag
      parameters:
        - $ref: "#/components/parameters/TagId"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateTagRequest"
            examples:
              rename:
                summary: Rename a tag
                value:
                  name: Warm lead
              recolor:
                summary: Change a tag's color
                value:
                  color: orange
      responses:
        "200":
          description: Tag updated.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TagEnvelope"
              example:
                data:
                  tag:
                    id: 3c9e1f2a7b4d4e8f9a0b1c2d3e4f5a6b
                    name: Warm lead
                    color: red
                    object_type: contact
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/AdminForbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
    delete:
      tags:
        - Tags
      x-mint:
        href: /developers/tags/delete-tag
      operationId: deleteTag
      summary: Delete tag
      description: Deletes a tag
      parameters:
        - $ref: "#/components/parameters/TagId"
      responses:
        "200":
          description: Tag deleted.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeleteTagEnvelope"
              example:
                data:
                  tag_id: 3c9e1f2a7b4d4e8f9a0b1c2d3e4f5a6b
                  deleted: true
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/AdminForbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/content:
    get:
      tags:
        - Content
      x-mint:
        href: /developers/content/list-content
      operationId: listContent
      summary: List content
      description: Lists LinkedIn posts and comments
      parameters:
        - $ref: "#/components/parameters/AccountId"
        - name: content_id
          in: query
          description: Filter by content ID, to read one post or comment.
          schema:
            type: string
        - name: contact_id
          in: query
          description: Filter by the author's contact ID, to read a contact's posts and comments found with `POST /v1/contacts/{contact_id}/find-content`.
          schema:
            type: string
            pattern: "^[1-9][0-9]*$"
        - name: view_id
          in: query
          description: |
            Filter by a saved content view. Accepts the view `id` or an unambiguous `public_id` from `GET /v1/views`.
            Uses the view's account and filters. An explicit `account_id` scope must include that account.
          schema:
            type: string
        - name: filters
          in: query
          description: |
            JSON array of filters content must all match, in the same shape as a content view's `filters`.
            Content fields (`content.`): `content_type`, `media_type`, `text`, `author`, `posted_at`, `reaction_count`, `comment_count`, `repost_count`, `source`, `tags`.
            The author's fields filter too: `member.` (such as `member.relationship_status`), `company.`, and `conversation.` (such as `conversation.has_conversation`).
            Requires exactly one account: pass one `account_id` when several are accessible.
          schema:
            type: string
          example: '[{"field":"content.content_type","operator":"=","value":"post"},{"field":"content.media_type","operator":"=","value":"document"}]'
        - name: sorts
          in: query
          description: |
            JSON array of sorts, first entry first, in the same shape as a content view's `sorts`, including the author's fields such as `member.follower_count`. Newest first by default.
            Requires exactly one account.
          schema:
            type: string
          example: '[{"field":"content.comment_count","direction":"desc"}]'
        - $ref: "#/components/parameters/Limit"
        - $ref: "#/components/parameters/Cursor"
      responses:
        "200":
          description: Posts and comments matching the filters.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListContentEnvelope"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/LinkedInNotConnected"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/content/import:
    post:
      tags:
        - Content
      x-mint:
        href: /developers/content/import-content
      operationId: importContent
      summary: Import content
      description: Imports one or multiple LinkedIn posts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ImportContentRequest"
            example:
              account_id: "42"
              linkedin_urls:
                - https://www.linkedin.com/feed/update/urn:li:activity:7254000000000000000/
      responses:
        "200":
          description: |
            One result per unique URL, in request order.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ImportContentEnvelope"
              example:
                data:
                  results:
                    - linkedin_url: https://www.linkedin.com/feed/update/urn:li:activity:7254000000000000000/
                      status: imported
                      content_id: cnt_0f8fad5bd9cb469fa16570867728950e
                      charged_credits: 1
                  charged_credits: 1
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "402":
          $ref: "#/components/responses/InsufficientCredits"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "429":
          $ref: "#/components/responses/RateLimited"
        "502":
          $ref: "#/components/responses/RequestFailed"
        "504":
          $ref: "#/components/responses/RequestTimeout"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/content/engagers/import:
    post:
      tags:
        - Content
      x-mint:
        href: /developers/content/import-content-engagers
      operationId: importContentEngagers
      summary: Import content engagers
      description: Imports a LinkedIn post's engagers as contacts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ImportContentEngagersRequest"
            examples:
              estimate:
                summary: Estimate the cost first
                value:
                  account_id: "42"
                  content_id: cnt_0f8fad5bd9cb469fa16570867728950e
                  estimate_only: true
              fromURL:
                summary: Import commenters and reactors of a post URL
                value:
                  account_id: "42"
                  linkedin_url: https://www.linkedin.com/feed/update/urn:li:activity:7254000000000000000/
      responses:
        "200":
          description: The estimate, or nothing new to import (`import_id` is null).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ImportContentEngagersEnvelope"
        "202":
          description: Import started in the background. Check progress with `GET /v1/contacts/imports/{import_id}`.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ImportContentEngagersEnvelope"
              example:
                data:
                  import:
                    import_id: eng_1234
                    content_id: cnt_0f8fad5bd9cb469fa16570867728950e
                    engagers_view_id: null
                    comment_count: 230
                    reaction_count: 410
                    estimated_credits: 15
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "402":
          $ref: "#/components/responses/InsufficientCredits"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/content/search:
    post:
      tags:
        - Content
      x-mint:
        href: /developers/content/search-posts
      operationId: searchPosts
      summary: Search posts
      description: Finds LinkedIn posts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SearchPostsRequest"
            example:
              keywords: cold outreach
              posted_within: week
              sort: newest
      responses:
        "200":
          description: |
            One page of up to 50 posts. They aren't in TalkToHumans yet: add one with `POST /v1/content/import`, or import its engagers with `POST /v1/content/engagers/import`, using its `linkedin_url`.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SearchPostsEnvelope"
              example:
                data:
                  content:
                    - author:
                        provider_participant_id: urn:li:fsd_profile:ACoAA000000
                        name: Jane Doe
                        headline: Founder at Example Co
                        linkedin_url: https://www.linkedin.com/in/jane-doe
                      text: Cold outreach isn't dead, it's lazy.
                      linkedin_url: https://www.linkedin.com/posts/jane-doe_cold-outreach-activity-7254000000000000000-abcd
                      posted_at: "2026-10-28T09:00:00Z"
                      reaction_count: 410
                      comment_count: 230
                      repost_count: 12
                      media_type: document
                  total_results: 1200
                  pagination:
                    limit: 50
                    has_more: true
                    next_cursor: eyJxdWVyeV9rZXkiOiIuLi4iLCJwYWdlIjoyfQ
                  charged_credits: 2
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "402":
          $ref: "#/components/responses/InsufficientCredits"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "429":
          $ref: "#/components/responses/RateLimited"
        "502":
          $ref: "#/components/responses/RequestFailed"
        "504":
          $ref: "#/components/responses/RequestTimeout"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/content/{content_id}:
    patch:
      tags:
        - Content
      x-mint:
        href: /developers/content/update-content
      operationId: updateContent
      summary: Update content
      description: Updates a LinkedIn post or comment
      parameters:
        - name: content_id
          in: path
          required: true
          description: Content ID returned by `GET /v1/content`.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateContentRequest"
            example:
              account_id: "42"
              tags:
                add:
                  - name: Lead magnet
                    color: green
      responses:
        "200":
          description: Content updated.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UpdateContentEnvelope"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/signals:
    post:
      tags:
        - LinkedIn
      x-mint:
        href: /developers/contacts/create-signals
      operationId: createSignals
      summary: Create signals
      description: Creates one or multiple signals on contacts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateSignalsRequest"
            example:
              account_id: "42"
              signals:
                - contact_id: "123"
                  signal_type: custom:webinar_attended
                  text: Attended the pricing webinar
                  occurred_at: "2026-10-28T17:00:00Z"
                  key: webinar-2026-10-28:123
      responses:
        "200":
          description: Signals written. Invalid ones are listed in `errors` and the others are written.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateSignalsEnvelope"
              example:
                data:
                  created: 1
                  updated: 0
                  errors: []
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/conversations:
    get:
      tags:
        - LinkedIn
      x-mint:
        href: /developers/conversations/list-conversations
      operationId: listConversations
      summary: List conversations
      description: Lists LinkedIn conversations
      parameters:
        - $ref: "#/components/parameters/AccountId"
        - name: view_id
          in: query
          description: |
            Filter by a saved inbox. Accepts the view `id` or an unambiguous `public_id` from `GET /v1/views`.
            Uses the view's account and filters. An explicit `account_id` scope must include that account.
            Results keep the endpoint's normal ordering.
          schema:
            type: string
        - name: contact_id
          in: query
          description: Filter by TalkToHumans contact ID. Use a positive integer encoded as a string.
          schema:
            type: string
            pattern: "^[1-9][0-9]*$"
        - name: filters
          in: query
          description: |
            JSON array of filters conversations must all match, in the same shape as an inbox's `filters`.
            Field keys name their record, such as `member.full_name` or `conversation.reply_state`. Use `conversation.messages` to match the text of synced messages.
            Requires exactly one account: pass one `account_id` when several are accessible.
          schema:
            type: string
          example: '[{"field":"conversation.reply_state","operator":"=","value":"waiting_for_my_reply"},{"field":"conversation.messages","operator":"contains","value":["pricing"]}]'
        - name: sorts
          in: query
          description: |
            JSON array of sorts, first entry first, in the same shape as an inbox's `sorts`.
            Requires exactly one account. Pages still follow `cursor`.
          schema:
            type: string
          example: '[{"field":"conversation.last_message_date","direction":"asc"}]'
        - $ref: "#/components/parameters/Limit"
        - $ref: "#/components/parameters/Cursor"
      responses:
        "200":
          description: Conversations matching the filters.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListConversationsEnvelope"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/LinkedInNotConnected"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/conversations/{conversationId}/messages:
    get:
      tags:
        - LinkedIn
      x-mint:
        href: /developers/conversations/list-messages
      operationId: listConversationMessages
      summary: List messages
      description: Lists messages from a LinkedIn conversation, newest first
      parameters:
        - name: conversationId
          in: path
          required: true
          description: Conversation ID returned by `GET /v1/conversations`.
          schema:
            type: string
        - name: account_id
          in: query
          required: false
          description: LinkedIn account ID returned by `GET /v1/accounts`. Required when the conversation exists under multiple LinkedIn accounts.
          schema:
            type: string
            pattern: "^[1-9][0-9]*$"
        - $ref: "#/components/parameters/Limit"
        - $ref: "#/components/parameters/Cursor"
      responses:
        "200":
          description: Messages in the conversation.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListConversationMessagesEnvelope"
              example:
                data:
                  message_sync_status: synced
                  messages:
                    - message_id: "123:message:urn:li:msg_message:abc"
                      provider_message_id: urn:li:msg_message:abc
                      conversation_id: chat_abc123
                      text: Thanks for connecting! Would Tuesday work for a quick call?
                      direction: received
                      sent_at: "2026-10-13T09:00:00Z"
                      is_edited: false
                      is_deleted: false
                      attachments: []
                  pagination:
                    limit: 10
                    has_more: false
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/conversations/drafts:
    post:
      tags:
        - LinkedIn
      x-mint:
        href: /developers/conversations/write-draft
      operationId: createMessageDraft
      summary: Write draft
      description: Creates, replaces, or clears a message, connection request, or sequence draft
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateMessageDraftRequest"
            examples:
              contact:
                summary: Draft a new message to an imported contact
                value:
                  account_id: "42"
                  contact_id: "123"
                  draft_message: Hi Jane, it was great learning about Acme.
              conversation:
                summary: Draft a reply to an existing conversation
                value:
                  account_id: "42"
                  conversation_id: chat_abc123
                  draft_message: Thanks for the thoughtful note. Would Tuesday work?
              attachments:
                summary: Draft a message with a file
                value:
                  account_id: "42"
                  contact_id: "123"
                  draft_message: Here is the 1-minute demo I mentioned.
                  attachments:
                    - file_id: file_3f2b8c1d9a4e4b7c8d2e1f0a9b8c7d6e
              sequence:
                summary: Draft a sequence for a contact
                value:
                  account_id: "42"
                  contact_id: "123"
                  steps:
                    - type: connection_request
                      delay_minutes: 0
                      content: Hi {{first_name}}, I'd love to connect.
                    - type: message
                      delay_minutes: 4320
                      content: Thanks for connecting, {{first_name}}! How is everything at {{company_name}}?
              template:
                summary: Draft a message from a template
                value:
                  account_id: "42"
                  contact_id: "123"
                  template_id: tpl_6f1d2c3a-8b4e-4f5a-9c7d-2e1b0a9f8c7d
                  variables:
                    event_name: SaaStr Annual
              connection_request:
                summary: Draft a connection request without a note
                value:
                  account_id: "42"
                  contact_id: "123"
                  connection_request: {}
              clear:
                summary: Clear a contact's draft
                value:
                  account_id: "42"
                  contact_id: "123"
                  clear: true
      responses:
        "200":
          description: Draft saved in TalkToHumans. The message was not sent.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateMessageDraftEnvelope"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/files:
    post:
      tags:
        - LinkedIn
      x-mint:
        href: /developers/conversations/upload-file
      operationId: uploadFile
      summary: Upload file
      description: Uploads a file to attach to messages.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/UploadFileForm"
          application/json:
            schema:
              $ref: "#/components/schemas/UploadFileRequest"
            examples:
              url:
                summary: Upload the file at a link
                value:
                  url: https://example.com/demo.gif
              file_name:
                summary: Get a link that uploads a local file
                value:
                  file_name: report.pdf
      responses:
        "200":
          description: Upload link for `file_name`. Send the file to it within 15 minutes; it answers like the `201` below.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UploadFileEnvelope"
              example:
                data:
                  upload:
                    url: https://api.talktohumans.app/v1/files/uploads/ful1.eyJvIjo0MiwiZSI6MTc5NDQxNTQwMH0.c2lnbmF0dXJl
                    command: curl -sS -F "file=@report.pdf" "https://api.talktohumans.app/v1/files/uploads/ful1.eyJvIjo0MiwiZSI6MTc5NDQxNTQwMH0.c2lnbmF0dXJl"
                    expires_at: "2026-11-11T15:30:00Z"
        "201":
          description: File uploaded. Attach it by its `file_id`; files nothing uses are deleted after 30 days.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UploadFileEnvelope"
              example:
                data:
                  file:
                    file_id: file_3f2b8c1d9a4e4b7c8d2e1f0a9b8c7d6e
                    kind: image
                    file_name: demo.gif
                    mime_type: image/gif
                    size_bytes: 482113
                    width: 480
                    height: 270
                    url: https://d111111abcdef8.cloudfront.net/file_3f2b8c1d9a4e4b7c8d2e1f0a9b8c7d6e?Signature=abc
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/files/uploads/{token}:
    post:
      tags:
        - LinkedIn
      x-mint:
        href: /developers/conversations/upload-file-with-link
      operationId: uploadFileWithLink
      summary: Upload file with link
      description: Uploads a file with an upload link.
      security: []
      parameters:
        - name: token
          in: path
          required: true
          description: Token of an upload link from `POST /v1/files` with `file_name`. It replaces the API key and works for 15 minutes.
          schema:
            type: string
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/UploadFileForm"
      responses:
        "201":
          description: File uploaded. Attach it by its `file_id`; files nothing uses are deleted after 30 days.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UploadFileEnvelope"
              example:
                data:
                  file:
                    file_id: file_3f2b8c1d9a4e4b7c8d2e1f0a9b8c7d6e
                    kind: file
                    file_name: report.pdf
                    mime_type: application/pdf
                    size_bytes: 225911
                    url: https://d111111abcdef8.cloudfront.net/file_3f2b8c1d9a4e4b7c8d2e1f0a9b8c7d6e?Signature=abc
        "400":
          $ref: "#/components/responses/BadRequest"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/sequences/{sequence_id}:
    patch:
      tags:
        - Sequences
      x-mint:
        href: /developers/sequences/update-sequence
      operationId: updateSequence
      summary: Update sequence
      description: Pauses or resumes a sequence
      parameters:
        - name: sequence_id
          in: path
          required: true
          description: Sequence ID from a contact's or conversation's `sequence.sequence_id`.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateSequenceRequest"
            examples:
              pause:
                summary: Pause a sequence
                value:
                  status: paused
              resume:
                summary: Resume a sequence
                value:
                  status: active
      responses:
        "200":
          description: Sequence updated.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SequenceEnvelope"
              example:
                data:
                  sequence:
                    sequence_id: "4512"
                    status: paused
                    stop_if_person_replies: true
                    reply_guard_after: "2026-06-02T12:00:00Z"
                    next_step_id: step_7f3a
                    next_step_scheduled_for: "2026-06-05T09:00:00Z"
                    steps:
                      - step_id: step_7f3a
                        step_type: send_message
                        trigger_type: scheduled_at
                        position: 1
                        scheduled_for: "2026-06-05T09:00:00Z"
                        message_mode: dm
                        state: pending
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
    delete:
      tags:
        - Sequences
      x-mint:
        href: /developers/sequences/delete-sequence
      operationId: deleteSequence
      summary: Delete sequence
      description: Deletes a sequence
      parameters:
        - name: sequence_id
          in: path
          required: true
          description: Sequence ID from a contact's or conversation's `sequence.sequence_id`.
          schema:
            type: string
      responses:
        "200":
          description: Sequence deleted.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeleteSequenceEnvelope"
              example:
                data:
                  sequence_id: "4512"
                  deleted: true
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/templates:
    get:
      tags:
        - Templates
      x-mint:
        href: /developers/templates/list-templates
      operationId: listTemplates
      summary: List templates
      description: List shared and personal templates
      parameters:
        - name: type
          in: query
          description: Filter by template type. Defaults to all.
          schema:
            type: string
            enum: [all, message, sequence]
            default: all
        - $ref: "#/components/parameters/Limit"
        - $ref: "#/components/parameters/Cursor"
      responses:
        "200":
          description: Templates.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListTemplatesEnvelope"
              example:
                data:
                  templates:
                    - template_id: tpl_6f1d2c3a-8b4e-4f5a-9c7d-2e1b0a9f8c7d
                      name: Event follow-up
                      type: message
                      scope: shared
                      content: Hi {{first_name}}, great meeting you at {{event_name}}. Would you be open to a quick call next week?
                      created_at: "2026-06-02T12:00:00Z"
                      updated_at: "2026-06-02T12:00:00Z"
                    - template_id: tpl_1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d
                      name: Connect and follow up
                      type: sequence
                      scope: personal
                      steps:
                        - type: connection_request
                          delay_minutes: 0
                          content: Hi {{first_name}}, I'd love to connect.
                        - type: message
                          delay_minutes: 4320
                          content: Thanks for connecting, {{first_name}}! How is everything at {{company_name}}?
                      created_at: "2026-06-05T12:00:00Z"
                      updated_at: "2026-06-07T12:00:00Z"
                  pagination:
                    limit: 10
                    has_more: false
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
    post:
      tags:
        - Templates
      x-mint:
        href: /developers/templates/create-template
      operationId: createTemplate
      summary: Create template
      description: Create a shared or personal template
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateTemplateRequest"
            examples:
              message:
                summary: Create a message template
                value:
                  name: Event follow-up
                  type: message
                  content: Hi {{first_name}}, great meeting you at {{event_name}}. Would you be open to a quick call next week?
              sequence:
                summary: Create a sequence template
                value:
                  name: Connect and follow up
                  type: sequence
                  steps:
                    - type: connection_request
                      delay_minutes: 0
                      content: Hi {{first_name}}, I'd love to connect.
                    - type: message
                      delay_minutes: 4320
                      content: Thanks for connecting, {{first_name}}! How is everything at {{company_name}}?
      responses:
        "201":
          description: Template created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TemplateEnvelope"
              example:
                data:
                  template:
                    template_id: tpl_6f1d2c3a-8b4e-4f5a-9c7d-2e1b0a9f8c7d
                    name: Event follow-up
                    type: message
                    scope: shared
                    content: Hi {{first_name}}, great meeting you at {{event_name}}. Would you be open to a quick call next week?
                    created_at: "2026-06-02T12:00:00Z"
                    updated_at: "2026-06-02T12:00:00Z"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/templates/{template_id}:
    patch:
      tags:
        - Templates
      x-mint:
        href: /developers/templates/update-template
      operationId: updateTemplate
      summary: Update template
      description: Update a shared or personal template
      parameters:
        - name: template_id
          in: path
          required: true
          description: Template ID returned by `GET /v1/templates` or `POST /v1/templates`.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateTemplateRequest"
            examples:
              rename:
                summary: Rename a template
                value:
                  name: Event follow-up (short)
              content:
                summary: Replace message content
                value:
                  content: Hi {{first_name}}, great meeting you at {{event_name}}. Open to a quick call?
      responses:
        "200":
          description: Template updated.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TemplateEnvelope"
              example:
                data:
                  template:
                    template_id: tpl_6f1d2c3a-8b4e-4f5a-9c7d-2e1b0a9f8c7d
                    name: Event follow-up
                    type: message
                    scope: shared
                    content: Hi {{first_name}}, great meeting you at {{event_name}}. Open to a quick call?
                    created_at: "2026-06-02T12:00:00Z"
                    updated_at: "2026-06-09T12:00:00Z"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/views:
    get:
      tags:
        - Views
      x-mint:
        href: /developers/views/list-views
      operationId: listViews
      summary: List saved views
      description: Lists saved inboxes, contact views, company views, and content views
      parameters:
        - name: type
          in: query
          description: Filter by view type. Defaults to contact.
          schema:
            type: string
            enum: [all, inbox, contact, company, content]
            default: contact
        - name: include_hidden
          in: query
          description: Include hidden views. Defaults to false.
          schema:
            type: boolean
            default: false
        - $ref: "#/components/parameters/AccountId"
        - $ref: "#/components/parameters/Limit"
        - $ref: "#/components/parameters/Cursor"
      responses:
        "200":
          description: Saved views.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListViewsEnvelope"
              example:
                data:
                  views:
                    - id: "789"
                      public_id: mem_2f5e3a4b
                      type: contact
                      view_kind: member
                      name: Relevant leads
                      description: Leads found in my network
                      account:
                        account_id: "42"
                        display_name: Jane Doe
                        provider_account_id: ACoAA000000
                        owner_user_id: "7"
                      view_type: table
                      icon: star
                      icon_color: red
                      position: 1
                      filters:
                        - field: member.tags
                          operator: contains
                          value:
                            - Hot lead
                      advanced_filters: null
                      sorts:
                        - field: member.connected_at
                          direction: desc
                      group_by: null
                      columns:
                        - member.full_name
                        - company.company_name
                        - member.job_title
                        - member.tags
                      count_mode: total
                      visibility_mode: always
                      conversation_open_mode: full
                      is_hidden: false
                      app_url: https://app.talktohumans.app/contacts/mem_2f5e3a4b
                      created_at: "2026-05-12T12:00:00Z"
                      updated_at: "2026-05-12T12:00:00Z"
                  pagination:
                    limit: 10
                    has_more: false
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "409":
          $ref: "#/components/responses/LinkedInNotConnected"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
    post:
      tags:
        - Views
      x-mint:
        href: /developers/views/create-view
      operationId: createView
      summary: Create view
      description: Create a saved inbox, contact view, company view, or content view
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateViewRequest"
            examples:
              contact:
                summary: Create a contact view
                value:
                  account_id: "42"
                  type: contact
                  name: Relevant leads
                  description: Leads found in my network
                  icon: star
                  icon_color: red
                  filters:
                    - field: member.tags
                      operator: contains
                      value:
                        - Hot lead
                    - field: member.connected_at
                      operator: relativeToToday
                      value:
                        direction: past
                        amount: 30
                        unit: day
                  sorts:
                    - field: member.connected_at
                      direction: desc
              specificContacts:
                summary: Create a view of specific contacts
                value:
                  account_id: "42"
                  name: Imported prospects
                  filters:
                    - field: member.specific_contacts
                      operator: contains
                      value:
                        - "123"
                        - "456"
              inbox:
                summary: Create an inbox
                value:
                  account_id: "42"
                  type: inbox
                  name: Hot leads
                  filters:
                    - field: member.tags
                      operator: contains
                      value:
                        - Hot lead
                    - field: conversation.reply_state
                      operator: "="
                      value: waiting_for_my_reply
                  group_by: conversation.last_message_date
              advancedFilters:
                summary: Create a view with advanced filters
                value:
                  account_id: "42"
                  name: Founders or hot leads
                  advanced_filters:
                    combinator: or
                    rules:
                      - field: member.tags
                        operator: contains
                        value:
                          - Hot lead
                      - combinator: and
                        rules:
                          - field: member.job_title
                            operator: contains
                            value:
                              - founder
                          - field: company.employee_count
                            operator: "<="
                            value: 50
                  columns:
                    - member.full_name
                    - member.job_title
                    - company.company_name
                    - member.tags
      responses:
        "201":
          description: View created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ViewEnvelope"
              example:
                data:
                  view:
                    id: "789"
                    public_id: mem_2f5e3a4b
                    type: contact
                    view_kind: member
                    name: Relevant leads
                    description: Leads found in my network
                    account:
                      account_id: "42"
                      display_name: Jane Doe
                      provider_account_id: ACoAA000000
                      owner_user_id: "7"
                    view_type: table
                    icon: star
                    icon_color: red
                    position: 3
                    filters:
                      - field: member.tags
                        operator: contains
                        value:
                          - Hot lead
                      - field: member.connected_at
                        operator: relativeToToday
                        value:
                          direction: past
                          amount: 30
                          unit: day
                    advanced_filters: null
                    sorts:
                      - field: member.connected_at
                        direction: desc
                    group_by: null
                    columns:
                      - member.full_name
                      - company.company_name
                      - member.job_title
                      - member.tags
                    count_mode: total
                    visibility_mode: always
                    conversation_open_mode: full
                    is_hidden: false
                    app_url: https://app.talktohumans.app/contacts/mem_2f5e3a4b
                    created_at: "2026-05-12T12:00:00Z"
                    updated_at: "2026-05-12T12:00:00Z"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "409":
          $ref: "#/components/responses/LinkedInNotConnected"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/views/{view_id}:
    patch:
      tags:
        - Views
      x-mint:
        href: /developers/views/update-view
      operationId: updateView
      summary: Update view
      description: Update a saved view's filters, sorts, and settings
      parameters:
        - name: view_id
          in: path
          required: true
          description: View `id` or unambiguous `public_id` returned by `GET /v1/views`.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateViewRequest"
            examples:
              filters:
                summary: Replace filters
                value:
                  filters:
                    - field: conversation.is_unread
                      operator: "="
                      value: true
              removeGrouping:
                summary: Remove grouping
                value:
                  group_by: ""
              rename:
                summary: Rename a view
                value:
                  name: Warm leads
              iconAndPosition:
                summary: Change the icon and its color, and move to the top
                value:
                  icon: star
                  icon_color: purple
                  position: 1
              columns:
                summary: Replace the columns
                value:
                  columns:
                    - member.full_name
                    - member.custom_fields.ICP score
                    - company.company_name
              advancedFilters:
                summary: Replace the advanced filters
                value:
                  advanced_filters:
                    combinator: or
                    rules:
                      - field: member.job_title
                        operator: contains
                        value:
                          - founder
                      - field: member.job_title
                        operator: contains
                        value:
                          - CEO
      responses:
        "200":
          description: View updated.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ViewEnvelope"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
    delete:
      tags:
        - Views
      x-mint:
        href: /developers/views/delete-view
      operationId: deleteView
      summary: Delete view
      description: Deletes a saved view
      parameters:
        - name: view_id
          in: path
          required: true
          description: View `id` or unambiguous `public_id` returned by `GET /v1/views`.
          schema:
            type: string
      responses:
        "200":
          description: View deleted.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeleteViewEnvelope"
              example:
                data:
                  view_id: "789"
                  deleted: true
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/AccountScopedForbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/skills:
    get:
      tags:
        - Agents
      x-mint:
        href: /developers/agents/list-skills
      operationId: listSkills
      summary: List skills
      description: |
        Lists the step-by-step playbooks the MCP serves with `load_skill`, in the order agents should consider them.
        Read `ground-rules` once per session, then the skill whose `use_when` matches the task. Playbooks name MCP tools; the CLI maps each tool to a command.
      responses:
        "200":
          description: Skills.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListSkillsEnvelope"
              example:
                data:
                  skills:
                    - name: ground-rules
                      use_when: "always, once at the start of every conversation: safety, data and workspace rules for every task."
                    - name: reply-triage
                      use_when: finding the replies the user owes and drafting them.
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/skills/{skill_name}:
    get:
      tags:
        - Agents
      x-mint:
        href: /developers/agents/get-skill
      operationId: getSkill
      summary: Get skill
      description: Returns one playbook as markdown, the same text the MCP's `load_skill` returns.
      parameters:
        - name: skill_name
          in: path
          required: true
          description: Skill `name` returned by `GET /v1/skills`.
          schema:
            type: string
      responses:
        "200":
          description: Skill markdown.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SkillEnvelope"
              example:
                data:
                  name: reply-triage
                  skill: "# Reply triage\n\n..."
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          description: Unknown skill. `message` lists the valid names.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                code: not_found
                message: 'unknown skill "spray-and-pray"; use one of: ground-rules, daily-outreach-loop, reply-triage, ...'
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /v1/feedback:
    post:
      tags:
        - Agents
      x-mint:
        href: /developers/agents/send-feedback
      operationId: sendFeedback
      summary: Send feedback
      description: |
        Tells the TalkToHumans team how the API, CLI or an agent workflow worked: a failure, a missing capability, a confusing parameter, or praise. No reply is sent.
        Works on every plan, so callers blocked by their plan can still report it.
        Keep `message` general: no names, profile URLs, emails, phone numbers, message text, notes or company names.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SendFeedbackRequest"
            examples:
              missing:
                summary: Missing capability
                value:
                  kind: missing
                  message: No command sends connection requests.
              confusing:
                summary: Confusing parameter
                value:
                  kind: confusing
                  message: The filters format for custom fields was unclear.
                  tool: list_contacts
      responses:
        "200":
          description: Feedback sent.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SendFeedbackEnvelope"
              example:
                data:
                  sent: true
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          description: The API key cannot resolve to an active organization.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              example:
                code: forbidden
                message: you don't have access to this organization
        "429":
          $ref: "#/components/responses/RateLimited"
        "500":
          $ref: "#/components/responses/InternalServerError"
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |
        Pass `Authorization: Bearer <credential>`, where the credential is either:
        - an API key (`sk_…`), generated by an organization admin in Settings, for scripts and automation;
        - an access token from `tth auth login` (the TalkToHumans CLI), which any member of the workspace can use.

        Both resolve to the same organization and user. A login token acts in the user's workspace: one with no workspace yet returns `403 workspace_setup_required`, and one in several workspaces returns `403 forbidden` (use an API key instead).
  parameters:
    TagId:
      name: tag_id
      in: path
      required: true
      description: Tag ID returned by `GET /v1/tags`.
      schema:
        type: string
    AccountId:
      name: account_id
      in: query
      description: |
        LinkedIn account IDs returned by `GET /v1/accounts`.

        Repeat the query parameter for multiple accounts. The backend also accepts comma-separated values.
        If an explicit account target is not accessible to this credential, the API returns `403 account_shared_access_required`.
      schema:
        type: array
        items:
          type: string
          pattern: "^[1-9][0-9]*$"
      style: form
      explode: true
    Limit:
      name: limit
      in: query
      description: Page size. Defaults to 10. Values above 25 are clamped to 25.
      schema:
        type: integer
        minimum: 1
        default: 10
        maximum: 25
    Cursor:
      name: cursor
      in: query
      description: Opaque cursor from the previous response's `pagination.next_cursor`.
      schema:
        type: string
    ActivityFrom:
      name: from
      in: query
      description: |
        Inclusive activity window start. Use RFC3339 or `YYYY-MM-DD`.
        Date-only values are interpreted in the requested `timezone`.
      schema:
        type: string
      example: "2026-07-01"
    ActivityTo:
      name: to
      in: query
      description: |
        Activity window end. Use RFC3339 or `YYYY-MM-DD`.
        A `YYYY-MM-DD` date is the last day included, in the requested `timezone`: for one week, pass its first and last days. An RFC3339 time is excluded.
        The response repeats the normalized exclusive instant in `filters.to` (or `window.to` for the summary) with `to_exclusive: true`.
      schema:
        type: string
      example: "2026-07-10"
    ActivityTimezone:
      name: timezone
      in: query
      description: IANA timezone used for date-only `from` and `to` filters. Defaults to `UTC`.
      schema:
        type: string
        default: UTC
      example: America/Los_Angeles
    ActivityAccountId:
      name: account_id
      in: query
      description: |
        Filter by TalkToHumans LinkedIn account ID in activity facts.
        Repeat the query parameter for multiple accounts. The backend also accepts comma-separated values.
      schema:
        type: array
        items:
          type: string
          pattern: "^[1-9][0-9]*$"
      style: form
      explode: true
    ActivityUserId:
      name: user_id
      in: query
      description: |
        Filter by TalkToHumans user ID in activity facts.
        Repeat the query parameter for multiple users. The backend also accepts comma-separated values.
      schema:
        type: array
        items:
          type: string
          pattern: "^[1-9][0-9]*$"
      style: form
      explode: true
    ActivityEventType:
      name: event_type
      in: query
      description: |
        Filter by activity event type.
        Repeat the query parameter for multiple event types. The backend also accepts comma-separated values.
      schema:
        type: array
        items:
          $ref: "#/components/schemas/ActivityEventType"
      style: form
      explode: true
    ActivityChannel:
      name: channel
      in: query
      description: |
        Filter by activity channel, such as `linkedin_message`, `linkedin_inmail`, or `linkedin_connection`.
        Repeat the query parameter for multiple channels. The backend also accepts comma-separated values.
      schema:
        type: array
        items:
          type: string
      style: form
      explode: true
    ActivitySource:
      name: source
      in: query
      description: |
        Filter by activity emitter source, such as `canonical_messages`, `canonical_chats`,
        `canonical_sequence_steps`, `sequence_runner_report`, or `canonical_account_participants`.
        Repeat the query parameter for multiple sources. The backend also accepts comma-separated values.
      schema:
        type: array
        items:
          type: string
      style: form
      explode: true
    ActivityTag:
      name: tag
      in: query
      description: Reserved for future tag-attributed reporting. Passing this parameter currently returns `400 bad_request`.
      schema:
        type: string
    ActivityLimit:
      name: limit
      in: query
      description: Page size for `GET /v1/activity`. Defaults to 50 and must be between 1 and 200.
      schema:
        type: integer
        minimum: 1
        maximum: 200
        default: 50
    ActivityCursor:
      name: cursor
      in: query
      description: Opaque cursor from the previous `GET /v1/activity` response's `pagination.next_cursor`.
      schema:
        type: string
  responses:
    BadRequest:
      description: Invalid request. `message` explains what to fix.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            code: bad_request
            message: 'field "account_id" must be a string, got number; IDs are strings, e.g. "42"'
    Unauthorized:
      description: Missing, malformed, invalid, or retired API key, or an invalid or expired login access token.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          examples:
            missingAuthorization:
              value:
                code: unauthorized
                message: Authorization header is required
            invalidAuthorizationFormat:
              value:
                code: unauthorized
                message: Authorization header must use Bearer scheme
            invalidAPIKey:
              value:
                code: unauthorized
                message: Invalid API key
            invalidAccessToken:
              value:
                code: unauthorized
                message: Invalid or expired access token
    Forbidden:
      description: API access is not enabled for the organization, the API key cannot resolve to an active organization user, or the login has no workspace yet.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          examples:
            forbidden:
              value:
                code: forbidden
                message: you don't have access to this organization
            featureUnavailable:
              value:
                code: billing_feature_not_available
                message: MCP and API access needs the Starter or Pro plan. This workspace is on the Free plan.
                action_url: https://app.talktohumans.app/?settings=usage
            insufficientCredits:
              value:
                code: billing_insufficient_credits
                message: "Not enough credits: this needs 50 and 12 are left."
                action_url: https://app.talktohumans.app/?settings=usage
            apiKeyPrincipalInvalid:
              value:
                code: forbidden
                message: This API key is no longer linked to an active organization user. Ask an organization admin to regenerate it
            workspaceSetupRequired:
              value:
                code: workspace_setup_required
                message: This TalkToHumans sign-in has no workspace yet. Open https://app.talktohumans.app, sign in with the same email to finish setting up TalkToHumans, then try again.
    AccountScopedForbidden:
      description: API access is not enabled for the organization, the API key cannot resolve to an active organization user, the login has no workspace yet, or the credential cannot access the requested LinkedIn account.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          examples:
            accountSharedAccessRequired:
              summary: Requested account is not accessible to this credential
              value:
                code: account_shared_access_required
                message: This account is not shared-access enabled for API or MCP. Ask an admin to enable shared access before using this account from this credential.
            forbidden:
              value:
                code: forbidden
                message: you don't have access to this organization
            featureUnavailable:
              value:
                code: billing_feature_not_available
                message: MCP and API access needs the Starter or Pro plan. This workspace is on the Free plan.
                action_url: https://app.talktohumans.app/?settings=usage
            insufficientCredits:
              value:
                code: billing_insufficient_credits
                message: "Not enough credits: this needs 50 and 12 are left."
                action_url: https://app.talktohumans.app/?settings=usage
            apiKeyPrincipalInvalid:
              value:
                code: forbidden
                message: This API key is no longer linked to an active organization user. Ask an organization admin to regenerate it
            workspaceSetupRequired:
              value:
                code: workspace_setup_required
                message: This TalkToHumans sign-in has no workspace yet. Open https://app.talktohumans.app, sign in with the same email to finish setting up TalkToHumans, then try again.
    AdminForbidden:
      description: API access is not enabled for the organization, the API key cannot resolve to an active organization user, or the credential's user is not an organization admin.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          examples:
            adminRequired:
              summary: Requires an organization admin (API key or login)
              value:
                code: forbidden
                message: Only organization admins can perform this action.
            forbidden:
              value:
                code: forbidden
                message: you don't have access to this organization
            featureUnavailable:
              value:
                code: billing_feature_not_available
                message: MCP and API access needs the Starter or Pro plan. This workspace is on the Free plan.
                action_url: https://app.talktohumans.app/?settings=usage
            insufficientCredits:
              value:
                code: billing_insufficient_credits
                message: "Not enough credits: this needs 50 and 12 are left."
                action_url: https://app.talktohumans.app/?settings=usage
            apiKeyPrincipalInvalid:
              value:
                code: forbidden
                message: This API key is no longer linked to an active organization user. Ask an organization admin to regenerate it
            workspaceSetupRequired:
              value:
                code: workspace_setup_required
                message: This TalkToHumans sign-in has no workspace yet. Open https://app.talktohumans.app, sign in with the same email to finish setting up TalkToHumans, then try again.
    InsufficientCredits:
      description: Not enough credits available.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            code: billing_insufficient_credits
            message: "Not enough credits: this needs 50 and 12 are left."
            action_url: https://app.talktohumans.app/?settings=usage
    NotFound:
      description: Requested resource was not found.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            code: not_found
            message: participant not found
    ProfileNotFound:
      description: Requested contact was not found, or the LinkedIn profile is not found or not publicly available.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          examples:
            linkedinProfileNotFound:
              summary: LinkedIn profile is not found or not publicly available
              value:
                code: linkedin_profile_not_found
                message: LinkedIn profile not found or not publicly available
            notFound:
              summary: Contact was not found
              value:
                code: not_found
                message: participant not found
    Conflict:
      description: Request conflicts with an existing resource.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            code: conflict
            message: custom field key already exists
    LinkedInNotConnected:
      description: The workspace has no LinkedIn account yet because the TalkToHumans extension was never set up, so there is no data to return. The message links the web app, which walks the user through connecting LinkedIn.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            code: linkedin_not_connected
            message: No LinkedIn account is connected to this workspace yet, so there is no data to return. Open https://app.talktohumans.app and follow the steps to connect LinkedIn; data then syncs while that browser is open.
    EnrichmentInProgress:
      description: Enrichment for this LinkedIn profile is already in progress. Retry shortly.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            code: enrichment_in_progress
            message: LinkedIn profile enrichment is already in progress; retry shortly
    RateLimited:
      description: Rate limit exceeded. Public routes allow 50 requests per 10 seconds per IP and endpoint.
      headers:
        Retry-After:
          description: Seconds to wait before retrying the request.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            code: rate_limit_exceeded
            message: Rate limit exceeded
    EnrichmentFailed:
      description: LinkedIn profile enrichment failed. Retry later.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            code: enrichment_failed
            message: LinkedIn profile enrichment failed; retry later
    EnrichmentTimeout:
      description: LinkedIn profile enrichment took too long. Retry in a minute.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            code: request_timeout
            message: Enriching this profile took longer than expected on our side. Try again in a minute.
    RequestFailed:
      description: The request couldn't be completed. No credits were used. Retry in a minute.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            code: upstream_error
            message: We couldn't complete this request on our side. No credits were used. Try again in a minute.
    RequestTimeout:
      description: The request took too long. No credits were used. Retry in a minute.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            code: request_timeout
            message: This took longer than expected on our side. No credits were used. Try again in a minute.
    InternalServerError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            code: internal_error
            message: An internal error occurred
  schemas:
    Error:
      type: object
      additionalProperties: false
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Machine-readable error code.
          enum:
            - unauthorized
            - forbidden
            - not_found
            - bad_request
            - internal_error
            - conflict
            - rate_limit_exceeded
            - account_shared_access_required
            - linkedin_not_connected
            - workspace_setup_required
            - billing_payment_failed
            - billing_subscription_incomplete
            - billing_subscription_expired
            - billing_grace_period
            - billing_feature_not_available
            - billing_insufficient_credits
            - billing_invalid
            - enrichment_failed
            - enrichment_in_progress
            - linkedin_profile_not_found
            - request_timeout
            - upstream_error
        message:
          type: string
          description: Human-readable error message.
        action_url:
          type: string
          format: uri
          description: Web app page that fixes the error, such as the plans or billing settings. Sent with billing errors. Only workspace admins can change billing.
        debug:
          type: string
          description: Development-only debug details.
    GetOrganizationEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/GetOrganizationResponse"
    GetOrganizationResponse:
      type: object
      additionalProperties: false
      required:
        - organization
      properties:
        organization:
          $ref: "#/components/schemas/Organization"
    CreditBalanceEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/CreditBalanceResponse"
    CreditBalanceResponse:
      type: object
      additionalProperties: false
      required:
        - credit_balance
        - plan
        - credit_costs
      properties:
        credit_balance:
          $ref: "#/components/schemas/CreditBalance"
        plan:
          $ref: "#/components/schemas/WorkspacePlan"
        credit_costs:
          $ref: "#/components/schemas/CreditCosts"
    WorkspacePlan:
      type: object
      additionalProperties: false
      required:
        - payment_past_due
        - action_url
      properties:
        name:
          type: string
          description: The workspace's plan, such as Free, Starter or Pro.
        trial_ends_at:
          type: string
          format: date-time
          description: When the trial ends, while the workspace is on one. The workspace then moves to the Free plan, which has no MCP or API access.
        payment_past_due:
          type: boolean
          description: True when the last payment failed. Access stops if the payment isn't fixed.
        action_url:
          type: string
          format: uri
          description: Web app page to fix the payment when payment_past_due is true, otherwise to upgrade the plan or buy more credits. Only workspace admins can change billing.
    CreditCosts:
      type: object
      additionalProperties: false
      description: Credits each action uses. Included plan credits renew every month and expire after 2 months. Purchased add-on credits expire after 12 months.
      required:
        - profile_enrichment
        - profile_content
        - content_post
        - content_engagers_per_100
        - people_search_page
        - post_search_page
        - job_search_page
        - work_email_found
        - mobile_phone_found
      properties:
        profile_enrichment:
          type: integer
          format: int64
          description: Enriching a profile and its company.
        profile_content:
          type: integer
          format: int64
          description: Getting a profile's posts and comments from the last 30 days.
        content_post:
          type: integer
          format: int64
          description: Importing a post.
        content_engagers_per_100:
          type: integer
          format: int64
          description: Importing a post's engagers, per 100 new commenters or reactors.
        people_search_page:
          type: integer
          format: int64
          description: A page of people search results.
        post_search_page:
          type: integer
          format: int64
          description: A page of post search results.
        job_search_page:
          type: integer
          format: int64
          description: A page of job search results, with their descriptions.
        work_email_found:
          type: integer
          format: int64
          description: A work email, only when found.
        mobile_phone_found:
          type: integer
          format: int64
          description: A mobile phone number, only when found.
    CreditBalance:
      type: object
      additionalProperties: false
      required:
        - available_credits
        - used_credits
        - total_credits
        - period_start
        - period_end
      properties:
        available_credits:
          type: integer
          format: int64
          description: Credits left in the current billing period.
        used_credits:
          type: integer
          format: int64
          description: Credits used in the current billing period, including usage still being recorded.
        total_credits:
          type: integer
          format: int64
          description: Credits included in the current billing period.
        period_start:
          type: string
          format: date-time
        period_end:
          type: string
          format: date-time
          description: When credits renew.
    Organization:
      type: object
      additionalProperties: false
      properties:
        id:
          type: integer
          format: int32
        name:
          type: string
        created_at:
          type: string
          format: date-time
    ListAccountsEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/ListAccountsResponse"
    ListAccountsResponse:
      type: object
      additionalProperties: false
      required:
        - accounts
      properties:
        accounts:
          type: array
          items:
            $ref: "#/components/schemas/Account"
    ListActivityEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/ActivityListResponse"
    ActivityListResponse:
      type: object
      additionalProperties: false
      required:
        - generated_at
        - timezone
        - filters
        - activity
        - pagination
        - caveats
      properties:
        generated_at:
          type: string
          format: date-time
        timezone:
          type: string
          description: IANA timezone used to interpret date-only request filters.
        filters:
          $ref: "#/components/schemas/ActivityFilters"
        activity:
          type: array
          items:
            $ref: "#/components/schemas/ActivityEvent"
        pagination:
          $ref: "#/components/schemas/ActivityPagination"
        caveats:
          type: array
          description: Why some activity may be missing, such as a LinkedIn list not synced recently. Empty when nothing is known to be missing.
          items:
            type: string
    ActivitySummaryEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/ActivitySummaryResponse"
    ActivitySummaryResponse:
      type: object
      additionalProperties: false
      required:
        - generated_at
        - timezone
        - window
        - totals
        - by_event_type
        - by_channel
        - by_source
        - by_user
        - by_account
        - by_template
        - template_metrics_basis
        - metrics
        - caveats
      properties:
        generated_at:
          type: string
          format: date-time
        timezone:
          type: string
        window:
          $ref: "#/components/schemas/ActivityWindow"
        totals:
          $ref: "#/components/schemas/ActivitySummaryTotals"
        by_event_type:
          type: array
          items:
            $ref: "#/components/schemas/ActivityStringCount"
        by_channel:
          type: array
          items:
            $ref: "#/components/schemas/ActivityStringCount"
        by_source:
          type: array
          items:
            $ref: "#/components/schemas/ActivityStringCount"
        by_user:
          type: array
          items:
            $ref: "#/components/schemas/ActivityIdCount"
        by_account:
          type: array
          items:
            $ref: "#/components/schemas/ActivityIdCount"
        by_template:
          type: array
          description: Per-template conversion metrics derived from attributed activity facts.
          items:
            $ref: "#/components/schemas/ActivityTemplateMetrics"
        template_metrics_basis:
          type: string
          description: Run activation and single-reply attribution rule used for per-template rates.
        metrics:
          $ref: "#/components/schemas/ActivityDerivedMetrics"
        caveats:
          type: array
          description: Why some counts may be too low, such as a LinkedIn list not synced recently. Empty when nothing is known to be missing.
          items:
            type: string
    ActivitySummaryTotals:
      type: object
      additionalProperties: false
      required:
        - events
        - unattributed_user_events
        - unattributed_account_events
      properties:
        events:
          type: integer
        unattributed_user_events:
          type: integer
        unattributed_account_events:
          type: integer
    ActivityStringCount:
      type: object
      additionalProperties: false
      required:
        - count
      properties:
        key:
          type: string
        count:
          type: integer
        missing:
          type: boolean
    ActivityIdCount:
      type: object
      additionalProperties: false
      required:
        - count
      properties:
        id:
          type: string
        count:
          type: integer
        unattributed:
          type: boolean
    ActivityDerivedMetrics:
      type: object
      additionalProperties: false
      required:
        - contacts_contacted_outbound
        - contacts_replied_to_outbound
        - reply_rate
        - connection_requests_sent
        - connection_requests_accepted
        - connection_request_acceptance_rate
        - basis
      properties:
        contacts_contacted_outbound:
          type: integer
          description: Conversations opened with a cold message in the window.
        contacts_replied_to_outbound:
          type: integer
          description: Of those conversations, how many got a reply, including after the window.
        reply_rate:
          type: number
          format: double
          minimum: 0
          maximum: 1
          nullable: true
          description: Replied conversations divided by conversations opened. Same as the analytics page.
        connection_requests_sent:
          type: integer
          description: Connection requests sent in the window.
        connection_requests_accepted:
          type: integer
          description: Contacts asked to connect in the window who accepted, including after the window.
        connection_request_acceptance_rate:
          type: number
          format: double
          minimum: 0
          maximum: 1
          nullable: true
          description: Accepted contacts divided by distinct contacts asked to connect. Same as the analytics page.
        basis:
          type: string
          description: How the funnel counts leads and outcomes.
    ActivityTemplateMetrics:
      type: object
      additionalProperties: false
      required:
        - template_key
        - template_public_id
        - template_type
        - outreach_runs_started
        - outreach_runs_replied
        - reply_rate
        - connection_requests_sent
        - connection_requests_accepted
        - connection_request_acceptance_rate
      properties:
        template_key:
          type: string
          description: Stable opaque template identity including scope and ownership.
        template_public_id:
          type: string
        template_type:
          type: string
          enum:
            - normal
            - sequence
        outreach_runs_started:
          type: integer
          description: Distinct template runs activated after a delivered outbound action.
        outreach_runs_replied:
          type: integer
          description: Activated template runs credited with a reply.
        reply_rate:
          type: number
          format: double
          minimum: 0
          maximum: 1
          nullable: true
        connection_requests_sent:
          type: integer
        connection_requests_accepted:
          type: integer
        connection_request_acceptance_rate:
          type: number
          format: double
          minimum: 0
          maximum: 1
          nullable: true
    ActivityWindow:
      type: object
      additionalProperties: false
      description: The window the counts cover, after date-only values were resolved in `timezone`.
      required:
        - to_exclusive
      properties:
        from:
          type: string
          format: date-time
          description: Normalized inclusive lower bound in UTC, when supplied.
        to:
          type: string
          format: date-time
          description: Normalized exclusive upper bound in UTC, when supplied.
        to_exclusive:
          type: boolean
          description: Always true. Counts include events where `occurred_at < to`.
    ActivityFilters:
      type: object
      additionalProperties: false
      required:
        - to_exclusive
        - tag_attribution
      properties:
        from:
          type: string
          format: date-time
          description: Normalized inclusive lower bound in UTC, when supplied.
        to:
          type: string
          format: date-time
          description: Normalized exclusive upper bound in UTC, when supplied.
        to_exclusive:
          type: boolean
          description: Always true. Activity queries include events where `occurred_at < to`.
        account_ids:
          type: array
          items:
            type: string
        user_ids:
          type: array
          items:
            type: string
        event_types:
          type: array
          items:
            $ref: "#/components/schemas/ActivityEventType"
        channels:
          type: array
          items:
            type: string
        sources:
          type: array
          items:
            type: string
        tag_attribution:
          type: string
          enum:
            - unavailable
          description: Tag filtering is intentionally unavailable until activity events include tag attribution metadata.
    ActivityEvent:
      type: object
      additionalProperties: false
      required:
        - id
        - occurred_at
        - recorded_at
        - event_type
        - source
        - attribution_method
      properties:
        id:
          type: string
          description: TalkToHumans activity event ID.
        occurred_at:
          type: string
          format: date-time
          description: When the activity happened.
        recorded_at:
          type: string
          format: date-time
          description: When TalkToHumans recorded the activity.
        event_type:
          $ref: "#/components/schemas/ActivityEventType"
        source:
          type: string
          description: Backend emitter that recorded the fact.
          example: canonical_messages
        channel:
          type: string
          description: Activity channel when known.
          example: linkedin_message
        user_id:
          type: string
          description: TalkToHumans user ID when the fact can be attributed to a user.
        account_id:
          type: string
          description: TalkToHumans LinkedIn account ID when the fact can be attributed to an account.
        subject_key:
          type: string
          description: Stable content-free contact identity used to deduplicate reporting metrics.
        template_run_public_id:
          type: string
          description: Template-run identity when the activity belongs to attributed outreach.
        template_key:
          type: string
          description: Stable opaque template identity snapshotted when the activity was recorded.
        template_public_id:
          type: string
        template_type:
          type: string
          enum:
            - normal
            - sequence
        attribution_method:
          type: string
          enum:
            - user_and_account
            - user
            - account
            - unattributed
        metadata:
          $ref: "#/components/schemas/ActivityMetadata"
    ActivityEventType:
      type: string
      enum:
        - connection_request_sent
        - connection_request_accepted
        - incoming_connection_request_accepted
        - message_scheduled
        - message_sent
        - follow_up_sent
        - message_received
        - outbound_reply_received
        - template_run_started
        - template_run_replied
        - content_engagers_imported
    ActivityMetadata:
      type: object
      additionalProperties:
        type: string
      description: |
        Small machine-readable metadata allowlist. Possible keys include `chat_provider`, `invite_entity_urn`,
        `invite_id`, `invitation_id`, `invitation_urn`, `message_mode`, `message_public_id`,
        `message_source`, `occurred_at_basis`, `outcome`, `participant_provider`, `position`,
        `previous_invite_type`, `provider_chat_id`, `provider_message_id`, `provider_participant_id`,
        `reason`, `relationship_source`, `reply_basis`, `scheduled_for`, `sequence_step_public_id`,
        `task_type`, `template_run_public_id`, and `template_status`.
        Message text, attachments, notes, drafts, and generated message bodies are never returned here.
    ActivityPagination:
      type: object
      additionalProperties: false
      required:
        - limit
        - has_more
      properties:
        limit:
          type: integer
          format: int32
          example: 50
        has_more:
          type: boolean
        next_cursor:
          type: string
          description: Cursor for the next activity page. Omitted when there are no more results.
    ListContactsEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/ListContactsResponse"
    ContactImportEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/ContactImportResponse"
    ContactImportResponse:
      type: object
      additionalProperties: false
      required:
        - import
      properties:
        import:
          $ref: "#/components/schemas/ContactImport"
    ContactImport:
      type: object
      additionalProperties: false
      required:
        - import_id
        - status
        - account
        - counts
        - results
        - warnings
      properties:
        import_id:
          type: string
          description: Import ID. Pass to `GET /v1/contacts/imports/{import_id}` to check progress.
        status:
          type: string
          description: "`running` while any profile is pending, then `completed`. An engager import can also end `failed`."
          enum:
            - running
            - completed
            - failed
        account:
          $ref: "#/components/schemas/AccountSummary"
        counts:
          $ref: "#/components/schemas/ContactImportCounts"
        estimated_seconds_left:
          type: integer
          description: Rough time until every profile is done, while profiles are pending. Omitted once nothing is pending.
        results:
          type: array
          description: One result per unique LinkedIn URL, in request order.
          items:
            $ref: "#/components/schemas/ContactImportResult"
        warnings:
          type: array
          description: Non-blocking warnings about stale LinkedIn sync state. Per-profile failures appear in `results`.
          items:
            $ref: "#/components/schemas/LinkedInWarning"
        content_engagers:
          $ref: "#/components/schemas/ContentEngagersImportResult"
        error:
          $ref: "#/components/schemas/ContactImportError"
    ContactImportCounts:
      type: object
      additionalProperties: false
      required:
        - total
        - pending
        - imported
        - already_present
        - failed
      properties:
        total:
          type: integer
        pending:
          type: integer
        imported:
          type: integer
        already_present:
          type: integer
        failed:
          type: integer
    ContactImportResult:
      type: object
      additionalProperties: false
      required:
        - linkedin_url
        - status
      properties:
        linkedin_url:
          type: string
          description: LinkedIn profile URL as submitted.
        status:
          type: string
          description: |
            `imported` when the contact was attached to the LinkedIn account for the first time, `already_present` when it was already attached, and `failed` when it could not be imported.
          enum:
            - pending
            - imported
            - already_present
            - failed
        contact_id:
          type: string
          description: TalkToHumans contact ID, present when `status` is `imported` or `already_present`.
        app_url:
          type: string
          format: uri
          description: Opens the contact in TalkToHumans, present when `status` is `imported` or `already_present`.
        sequence_id:
          type: string
          description: The contact's launched sequence, if any.
        has_draft:
          type: boolean
          description: True when a message or sequence is already drafted for the contact.
        error:
          $ref: "#/components/schemas/ContactImportError"
    ContactImportError:
      type: object
      additionalProperties: false
      description: Failure reason, present when `status` is `failed`.
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Machine-readable error code, such as `linkedin_profile_not_found`, `enrichment_failed`, or `billing_insufficient_credits`.
        message:
          type: string
          description: Human-readable error message.
    SearchPeopleRequest:
      type: object
      additionalProperties: false
      description: |
        At least one filter besides `exclude`, or `sales_navigator_url` alone.
        List filters match any of their values, and people must match every filter set.
      properties:
        account_id:
          type: string
          description: LinkedIn account ID returned by `GET /v1/accounts`. Required when the organization has multiple LinkedIn accounts.
          pattern: "^[1-9][0-9]*$"
        keywords:
          type: string
          maxLength: 200
          description: Words to search for, such as a skill or a name. Supports LinkedIn's `AND`, `OR` and `NOT`.
        job_titles:
          type: array
          maxItems: 20
          description: Current job titles, such as `Head of Sales`.
          items:
            type: string
        past_job_titles:
          type: array
          maxItems: 20
          description: Past job titles.
          items:
            type: string
        company_linkedin_urls:
          type: array
          maxItems: 20
          description: LinkedIn company page URLs of their current employer, such as `https://www.linkedin.com/company/google`.
          items:
            type: string
        past_company_linkedin_urls:
          type: array
          maxItems: 20
          description: LinkedIn company page URLs of their past employers.
          items:
            type: string
        school_linkedin_urls:
          type: array
          maxItems: 20
          description: LinkedIn school page URLs, such as `https://www.linkedin.com/school/stanford-university`.
          items:
            type: string
        locations:
          type: array
          maxItems: 20
          description: Locations, such as `Paris` or `United States`.
          items:
            type: string
        industries:
          type: array
          maxItems: 20
          description: Industries of their current employer, as LinkedIn company pages name them, such as `Software Development` or `Financial Services`. An unknown one fails with the closest names.
          items:
            type: string
        seniorities:
          type: array
          maxItems: 20
          description: Seniority levels (`In Training`, `Entry Level`, `Senior`, `Strategic`, `Entry Level Manager`, `Experienced Manager`, `Director`, `Vice President`, `CXO` or `Owner / Partner`).
          items:
            type: string
        company_sizes:
          type: array
          maxItems: 20
          description: Employee counts of their current employer (`self-employed`, `1-10`, `11-50`, `51-200`, `201-500`, `501-1000`, `1001-5000`, `5001-10000` or `10001+`).
          items:
            type: string
        languages:
          type: array
          maxItems: 20
          description: Languages of their LinkedIn profile (`Arabic`, `Bahasa Indonesia`, `Chinese`, `Czech`, `Danish`, `Dutch`, `English`, `French`, `German`, `Italian`, `Japanese`, `Korean`, `Malay`, `Norwegian`, `Polish`, `Portuguese`, `Romanian`, `Russian`, `Spanish`, `Swedish`, `Tagalog` or `Turkish`).
          items:
            type: string
        exclude:
          $ref: "#/components/schemas/SearchPeopleExclusions"
        sales_navigator_url:
          type: string
          description: |
            Sales Navigator lead search URL, copied from the address bar, instead of every other filter.
            Filters tied to your own Sales Navigator account (lead and account lists, connections, past colleagues, saved leads, lead interactions, personas, profile viewers, company followers, shared experiences) aren't supported.
        cursor:
          type: string
          description: Cursor returned as `data.pagination.next_cursor` by the previous call. It carries its search, so the filters can be left out; if you pass them, they must be the same.
    SearchPeopleExclusions:
      type: object
      additionalProperties: false
      description: People to leave out, matching any of these values. Values are as in the filters of the same name.
      properties:
        job_titles:
          type: array
          maxItems: 20
          description: Current job titles.
          items:
            type: string
        past_job_titles:
          type: array
          maxItems: 20
          description: Past job titles.
          items:
            type: string
        company_linkedin_urls:
          type: array
          maxItems: 20
          description: LinkedIn company page URLs of current employers.
          items:
            type: string
        past_company_linkedin_urls:
          type: array
          maxItems: 20
          description: LinkedIn company page URLs of past employers.
          items:
            type: string
        school_linkedin_urls:
          type: array
          maxItems: 20
          description: LinkedIn school page URLs.
          items:
            type: string
        locations:
          type: array
          maxItems: 20
          description: Locations.
          items:
            type: string
        industries:
          type: array
          maxItems: 20
          description: Industries of the current employer.
          items:
            type: string
        seniorities:
          type: array
          maxItems: 20
          description: Seniority levels.
          items:
            type: string
    SearchPeopleEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/SearchPeopleResponse"
    SearchPeopleResponse:
      type: object
      additionalProperties: false
      required:
        - people
        - total_results
        - pagination
        - charged_credits
      properties:
        people:
          type: array
          items:
            $ref: "#/components/schemas/SearchPerson"
        total_results:
          type: integer
          description: People LinkedIn counts for this search. At most 100 pages can be read.
        pagination:
          $ref: "#/components/schemas/Pagination"
        charged_credits:
          type: integer
          format: int64
    SearchPerson:
      type: object
      additionalProperties: false
      description: |
        A person found on LinkedIn, not a contact yet, so there is no `contact_id`: `linkedin_url` carries a Sales Navigator ID that only `POST /v1/contacts` resolves. Importing skips people who already are contacts.
      required:
        - name
        - linkedin_url
      properties:
        name:
          type: string
        first_name:
          type: string
        last_name:
          type: string
        primary_role_title:
          type: string
        primary_company_name:
          type: string
        primary_company_linkedin_url:
          type: string
          format: uri
        primary_company_industry:
          type: string
        location:
          type: string
        linkedin_url:
          type: string
          format: uri
          description: Import this person with `POST /v1/contacts`.
        avatar_url:
          type: string
          format: uri
    SearchJobsRequest:
      type: object
      additionalProperties: false
      description: A `location`, and at least one of `keywords` or `company_linkedin_urls`. Jobs must match every filter set.
      properties:
        account_id:
          type: string
          description: LinkedIn account ID returned by `GET /v1/accounts`. Required when the organization has multiple LinkedIn accounts.
          pattern: "^[1-9][0-9]*$"
        keywords:
          type: string
          maxLength: 200
          description: Words in the job title, such as `Sales Development Representative`.
        company_linkedin_urls:
          type: array
          maxItems: 20
          description: LinkedIn company page URLs of the hiring companies. Matches any of them.
          items:
            type: string
        location:
          type: string
          maxLength: 200
          description: Where the jobs are, such as `France`, `United States` or `Greater Paris Metropolitan Region`. Required, unless `cursor` continues a search.
        posted_within:
          type: string
          description: Only jobs posted in the last 24 hours, week or month.
          enum:
            - 24h
            - week
            - month
        cursor:
          type: string
          description: Cursor returned as `data.pagination.next_cursor` by the previous call. It carries its search, so the filters can be left out; if you pass them, they must be the same.
    SearchJobsEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/SearchJobsResponse"
    SearchJobsResponse:
      type: object
      additionalProperties: false
      required:
        - jobs
        - total_results
        - pagination
        - charged_credits
      properties:
        jobs:
          type: array
          items:
            $ref: "#/components/schemas/JobSearchResult"
        total_results:
          type: integer
          description: About how many jobs LinkedIn counts for this search. At most 40 pages can be read.
        pagination:
          $ref: "#/components/schemas/Pagination"
        charged_credits:
          type: integer
          format: int64
    JobSearchResult:
      type: object
      additionalProperties: false
      description: A LinkedIn job post. Jobs aren't saved in TalkToHumans.
      required:
        - title
        - linkedin_url
      properties:
        title:
          type: string
        linkedin_url:
          type: string
          format: uri
        company_name:
          type: string
        company_linkedin_url:
          type: string
          format: uri
          description: Find who to contact there with `POST /v1/people/search` and `company_linkedin_urls`.
        location:
          type: string
        posted_at:
          type: string
          format: date-time
        employment_type:
          type: string
          description: Such as `full_time`, `part_time`, `contract` or `internship`.
        workplace_type:
          type: string
          description: Such as `on_site`, `hybrid` or `remote`.
        applicant_count:
          type: integer
        description:
          type: string
          description: The job description, cut after 3,000 characters. Empty when it couldn't be read this time; searching again later reads it.
    ImportContactsRequest:
      type: object
      additionalProperties: false
      required:
        - account_id
        - linkedin_urls
      properties:
        account_id:
          type: string
          description: LinkedIn account ID returned by `GET /v1/accounts`.
          pattern: "^[1-9][0-9]*$"
        linkedin_urls:
          type: array
          minItems: 1
          maxItems: 500
          description: |
            LinkedIn member profile URLs under `linkedin.com/in/`. Query parameters and paths after the member identifier are ignored, and duplicates are imported once.
            Company pages and other links are rejected.
          items:
            type: string
            format: uri
            pattern: "^https?://(www\\.)?linkedin\\.com/in/[^/?#]+(?:[/?#].*)?$"
    DeleteContactsRequest:
      type: object
      additionalProperties: false
      required:
        - account_id
        - contact_ids
      properties:
        account_id:
          type: string
          description: LinkedIn account ID returned by `GET /v1/accounts`.
          pattern: "^[1-9][0-9]*$"
        contact_ids:
          type: array
          minItems: 1
          maxItems: 500
          description: Contact IDs returned by `GET /v1/contacts`. Duplicates are deleted once.
          items:
            type: string
            pattern: "^[1-9][0-9]*$"
    DeleteContactsEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: object
          additionalProperties: false
          required:
            - deleted
            - skipped
            - deleted_sequences
            - deleted_drafts
          properties:
            deleted:
              type: array
              description: IDs of the deleted contacts.
              items:
                type: string
            skipped:
              type: array
              description: Contacts that were not deleted, in request order.
              items:
                $ref: "#/components/schemas/SkippedContact"
            deleted_sequences:
              type: integer
              description: Sequences deleted with their contacts.
            deleted_drafts:
              type: integer
              description: Drafts deleted with their contacts.
    SkippedContact:
      type: object
      additionalProperties: false
      required:
        - contact_id
        - reason
        - message
      properties:
        contact_id:
          type: string
        reason:
          type: string
          enum:
            - connected
            - invitation_pending
            - in_conversation
            - sending_now
            - not_found
          description: |
            Why the contact was kept. LinkedIn would add back a contact that is `connected`, has a pending invitation (`invitation_pending`), or is `in_conversation`.
            `sending_now` means a sequence message is being sent; retry in a minute. `not_found` means the ID isn't a contact of this account.
        message:
          type: string
          description: The reason in plain words, as shown in the app.
    LinkedInWarning:
      type: object
      additionalProperties: false
      required:
        - code
        - account_id
        - message
      properties:
        code:
          type: string
          enum:
            - linkedin_sync_required
        account_id:
          type: string
          description: LinkedIn account ID associated with the warning.
        message:
          type: string
          enum:
            - For security, TalkToHumans does not run LinkedIn actions or sync LinkedIn data in the cloud. Open TalkToHumans with this LinkedIn account connected to refresh its data before relying on it or running actions.
    ListContactsResponse:
      type: object
      additionalProperties: false
      required:
        - contacts
        - pagination
      properties:
        contacts:
          type: array
          items:
            $ref: "#/components/schemas/Contact"
        pagination:
          $ref: "#/components/schemas/Pagination"
    CustomFieldValue:
      nullable: true
      description: Custom field value. Text fields return strings, number fields return numbers, boolean fields return booleans, and date fields return `YYYY-MM-DD` strings. Null appears only when a value is explicitly cleared or absent in a write response.
      oneOf:
        - type: string
        - type: number
        - type: boolean
    CustomFieldValueInput:
      nullable: true
      description: Value for a registered custom field key. Use null to clear. Date fields must use `YYYY-MM-DD` strings.
      oneOf:
        - type: string
        - type: number
        - type: boolean
    ListCustomFieldsEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/ListCustomFieldsResponse"
    ListCustomFieldsResponse:
      type: object
      additionalProperties: false
      required:
        - custom_fields
      properties:
        custom_fields:
          type: array
          items:
            $ref: "#/components/schemas/CustomField"
    ListTagsEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/ListTagsResponse"
    ListTagsResponse:
      type: object
      additionalProperties: false
      required:
        - tags
      properties:
        tags:
          type: array
          items:
            $ref: "#/components/schemas/TagDefinition"
    TagEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: object
          additionalProperties: false
          required:
            - tag
          properties:
            tag:
              $ref: "#/components/schemas/TagDefinition"
    DeleteTagEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: object
          additionalProperties: false
          required:
            - tag_id
            - deleted
          properties:
            tag_id:
              type: string
            deleted:
              type: boolean
    TagDefinition:
      type: object
      additionalProperties: false
      required:
        - id
        - name
        - color
        - object_type
      properties:
        id:
          type: string
          description: Tag ID for updating or deleting the tag. Contact and company updates use the name.
        name:
          type: string
        color:
          $ref: "#/components/schemas/TagColor"
        object_type:
          type: string
          enum: [contact, company]
    UpdateTagRequest:
      type: object
      additionalProperties: false
      minProperties: 1
      properties:
        name:
          type: string
          minLength: 1
          description: New name, unique among contact or company tags.
        color:
          $ref: "#/components/schemas/TagColor"
    TagColor:
      type: string
      enum:
        - green
        - orange
        - blue
        - red
        - purple
        - yellow
        - pink
        - grey
    CustomFieldEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/CustomFieldResponse"
    CustomFieldResponse:
      type: object
      additionalProperties: false
      required:
        - custom_field
      properties:
        custom_field:
          $ref: "#/components/schemas/CustomField"
    CreateCustomFieldRequest:
      type: object
      additionalProperties: false
      required:
        - name
        - field_type
      properties:
        name:
          type: string
          minLength: 1
          description: Field name shown in TalkToHumans. Must be unique per object type.
        field_type:
          type: string
          description: Value type. It can't be changed later.
          enum:
            - text
            - number
            - boolean
            - date
        object_type:
          type: string
          enum:
            - contact
            - company
          default: contact
    CustomField:
      type: object
      additionalProperties: false
      required:
        - id
        - name
        - field_type
        - object_type
      properties:
        id:
          type: string
          description: Custom field ID.
        name:
          type: string
          description: Key used in contact and company updates, as `member.custom_fields.<name>` or `company.custom_fields.<name>` in filters, and as a top-level response property.
        field_type:
          type: string
          description: Text fields hold strings, number fields numbers, boolean fields booleans, and date fields `YYYY-MM-DD` strings.
          enum:
            - text
            - number
            - boolean
            - date
        object_type:
          type: string
          enum:
            - contact
            - company
    EnrichProfileEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/EnrichProfileResponse"
    EnrichProfileResponse:
      type: object
      additionalProperties: false
      required:
        - linkedin_enrichment
      properties:
        linkedin_enrichment:
          $ref: "#/components/schemas/LinkedInEnrichment"
    LinkedInEnrichment:
      type: object
      additionalProperties: false
      description: LinkedIn profile enrichment data. The profile is enriched first, then the current primary company is enriched when available.
      properties:
        profile:
          $ref: "#/components/schemas/EnrichedParticipantSnapshot"
        company:
          $ref: "#/components/schemas/EnrichedParticipantSnapshot"
    EnrichProfileRequest:
      type: object
      additionalProperties: false
      description: |
        Provide exactly one target: `contact_id`, `provider_participant_id`, `linkedin_url`, or `public_identifier`.
      oneOf:
        - required:
            - contact_id
        - required:
            - provider_participant_id
        - required:
            - linkedin_url
        - required:
            - public_identifier
      properties:
        account_id:
          type: string
          description: LinkedIn account ID returned by `GET /v1/accounts`. Required when the organization has multiple LinkedIn accounts.
          pattern: "^[1-9][0-9]*$"
        contact_id:
          type: string
          description: Contact ID returned by `GET /v1/contacts`.
          pattern: "^[1-9][0-9]*$"
        provider_participant_id:
          type: string
          description: LinkedIn participant ID, such as `urn:li:fsd_profile:abc`.
        linkedin_url:
          type: string
          format: uri
          description: LinkedIn profile URL.
        public_identifier:
          type: string
          description: LinkedIn public identifier from a profile URL.
        force:
          type: boolean
          description: Refresh cached enrichment data even when fresh data is already available.
          default: false
    EnrichedParticipantSnapshot:
      type: object
      additionalProperties: false
      required:
        - participant
        - languages
        - experiences
        - educations
        - locations
        - industries
      properties:
        participant:
          $ref: "#/components/schemas/EnrichedParticipant"
        languages:
          type: array
          items:
            $ref: "#/components/schemas/EnrichedLanguage"
        experiences:
          type: array
          items:
            $ref: "#/components/schemas/EnrichedExperience"
        educations:
          type: array
          items:
            $ref: "#/components/schemas/EnrichedEducation"
        locations:
          type: array
          items:
            $ref: "#/components/schemas/EnrichedLocation"
        industries:
          type: array
          items:
            $ref: "#/components/schemas/EnrichedIndustry"
    EnrichedParticipant:
      type: object
      additionalProperties: false
      required:
        - provider
        - provider_participant_id
        - kind
        - updated_at
      properties:
        provider:
          type: string
        provider_participant_id:
          type: string
        kind:
          type: string
          description: Participant kind, usually `member` or `company`.
        public_identifier:
          type: string
          nullable: true
        profile_url:
          type: string
          format: uri
          nullable: true
        first_name:
          type: string
          nullable: true
        last_name:
          type: string
          nullable: true
        full_name:
          type: string
          nullable: true
        headline:
          type: string
          nullable: true
        avatar_url:
          type: string
          format: uri
          nullable: true
        background_cover_url:
          type: string
          format: uri
          nullable: true
        headcount:
          type: string
          nullable: true
        employee_count:
          type: integer
          nullable: true
        founding_date:
          type: string
          nullable: true
        website_url:
          type: string
          format: uri
          nullable: true
        profile_action_label:
          type: string
          nullable: true
        profile_action_url:
          type: string
          format: uri
          nullable: true
        follower_count:
          type: integer
          nullable: true
        connections_count:
          type: integer
          nullable: true
        primary_company:
          $ref: "#/components/schemas/ParticipantKey"
        primary_company_name:
          type: string
          nullable: true
        primary_role_title:
          type: string
          nullable: true
        about:
          type: string
          nullable: true
        profile_fetched_at:
          type: string
          format: date-time
          nullable: true
        updated_at:
          type: string
          format: date-time
    ParticipantKey:
      type: object
      additionalProperties: false
      nullable: true
      required:
        - provider
        - provider_participant_id
      properties:
        provider:
          type: string
        provider_participant_id:
          type: string
    EnrichedLanguage:
      type: object
      additionalProperties: false
      required:
        - language
      properties:
        language:
          type: string
        metadata_json:
          type: string
          nullable: true
    EnrichedExperience:
      type: object
      additionalProperties: false
      required:
        - is_current
      properties:
        company:
          $ref: "#/components/schemas/ParticipantKey"
        company_name:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        employment_type:
          type: string
          nullable: true
        location:
          type: string
          nullable: true
        start_at:
          type: string
          nullable: true
        end_at:
          type: string
          nullable: true
        is_current:
          type: boolean
        description:
          type: string
          nullable: true
        metadata_json:
          type: string
          nullable: true
    EnrichedEducation:
      type: object
      additionalProperties: false
      properties:
        school:
          $ref: "#/components/schemas/ParticipantKey"
        school_name:
          type: string
          nullable: true
        degree:
          type: string
          nullable: true
        field_of_study:
          type: string
          nullable: true
        start_at:
          type: string
          nullable: true
        end_at:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        metadata_json:
          type: string
          nullable: true
    EnrichedLocation:
      type: object
      additionalProperties: false
      required:
        - source
        - sort_order
        - is_primary
        - is_headquarter
      properties:
        source:
          type: string
        sort_order:
          type: integer
          format: int32
        is_primary:
          type: boolean
        is_headquarter:
          type: boolean
        linkedin_text:
          type: string
          nullable: true
        display_text:
          type: string
          nullable: true
        country_code:
          type: string
          nullable: true
        region_code:
          type: string
          nullable: true
        country:
          type: string
          nullable: true
        country_full:
          type: string
          nullable: true
        state:
          type: string
          nullable: true
        city:
          type: string
          nullable: true
        geographic_area:
          type: string
          nullable: true
        line1:
          type: string
          nullable: true
        line2:
          type: string
          nullable: true
        postal_code:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        metadata_json:
          type: string
          nullable: true
    EnrichedIndustry:
      type: object
      additionalProperties: false
      required:
        - sort_order
      properties:
        sort_order:
          type: integer
          format: int32
        industry_urn:
          type: string
          nullable: true
        provider_industry_id:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        hierarchy:
          type: string
          nullable: true
        metadata_json:
          type: string
          nullable: true
    FindContactInfoRequest:
      type: object
      additionalProperties: false
      properties:
        account_id:
          type: string
          pattern: "^[1-9][0-9]*$"
          description: LinkedIn account ID returned by `GET /v1/accounts`. Required when multiple accessible LinkedIn accounts exist.
        force:
          type: boolean
          default: false
          description: Refresh cached results.
    FindContactInfoEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/FindContactInfoResponse"
    FindContactInfoResponse:
      type: object
      additionalProperties: false
      required:
        - contact
      properties:
        contact:
          $ref: "#/components/schemas/ContactSummary"
    ContactEnrichment:
      type: object
      additionalProperties: false
      description: Work email and mobile phone lookup progress. Read contact results without starting a lookup or spending enrichment credits.
      required:
        - work_email
        - phone
      properties:
        work_email:
          $ref: "#/components/schemas/ContactEnrichmentState"
        phone:
          $ref: "#/components/schemas/ContactEnrichmentState"
    ContactEnrichmentState:
      type: object
      additionalProperties: false
      required:
        - status
      properties:
        status:
          type: string
          enum: [not_requested, enriching, found, not_found, failed]
          description: Lookup status. Found values appear in the contact's `work_email` or `phone` field. Failed lookups can be retried with the find endpoint.
        error_code:
          type: string
          description: Failure code, present only when the lookup failed. `lookup_timed_out` means the lookup exceeded its expected duration.
    UpdateContactEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/UpdateContactResponse"
    UpdateContactResponse:
      type: object
      additionalProperties: false
      required:
        - contact
      properties:
        contact:
          $ref: "#/components/schemas/ContactSummary"
    UpdateContactRequest:
      type: object
      additionalProperties:
        $ref: "#/components/schemas/CustomFieldValueInput"
      description: |
        Contact update payload. Known system keys, including `tags` and `notes`, are documented below. Any additional top-level key is treated
        as a registered custom field key. Provide at least one of `tags`, `notes`, or a custom field key.
      minProperties: 1
      properties:
        account_id:
          type: string
          description: LinkedIn account ID returned by `GET /v1/accounts`. Required when the contact exists under multiple LinkedIn accounts.
          pattern: "^[1-9][0-9]*$"
        tags:
          $ref: "#/components/schemas/ContactTagsPatch"
        notes:
          $ref: "#/components/schemas/NotesPatch"
    ContactTagsPatch:
      type: object
      additionalProperties: false
      description: Use `set` for exact replacement, or `add`/`remove` for incremental updates. `set` cannot be combined with `add` or `remove`.
      properties:
        add:
          type: array
          items:
            $ref: "#/components/schemas/ContactTagInput"
        remove:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 64
        set:
          type: array
          items:
            $ref: "#/components/schemas/ContactTagInput"
    ContactTagInput:
      type: object
      additionalProperties: false
      required:
        - name
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 64
        color:
          type: string
          description: Defaults to blue when omitted.
          enum:
            - green
            - orange
            - blue
            - red
            - purple
            - yellow
            - pink
            - grey
    NotesPatch:
      type: object
      additionalProperties: false
      description: |
        Use `set` for exact replacement, or `add`/`remove` for incremental updates. `set` cannot be combined with `add` or `remove`.
        A contact or company can have at most 20 notes.
      properties:
        add:
          type: array
          description: Notes to add before the existing notes. A note whose content matches an existing note is skipped, so retried requests do not duplicate notes.
          items:
            $ref: "#/components/schemas/NoteInput"
        remove:
          type: array
          description: "`note_id` values to remove. Unknown IDs are ignored."
          items:
            type: string
        set:
          type: array
          description: Exact replacement for all notes, newest first. Use an empty list to clear notes.
          items:
            $ref: "#/components/schemas/NoteInput"
    NoteInput:
      type: object
      additionalProperties: false
      required:
        - content
      properties:
        content:
          type: string
          minLength: 1
          maxLength: 8000
          description: Plain-text note content.
    Note:
      type: object
      additionalProperties: false
      required:
        - note_id
        - content
        - created_at
      properties:
        note_id:
          type: string
          description: Note ID. Pass in `notes.remove` to delete the note.
        content:
          type: string
          description: Plain-text note content.
        created_at:
          type: string
          format: date-time
    ListCompaniesEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/ListCompaniesResponse"
    ListCompaniesResponse:
      type: object
      additionalProperties: false
      required:
        - companies
        - pagination
      properties:
        companies:
          type: array
          items:
            $ref: "#/components/schemas/Company"
        pagination:
          $ref: "#/components/schemas/Pagination"
    UpdateCompanyEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/UpdateCompanyResponse"
    UpdateCompanyResponse:
      type: object
      additionalProperties: false
      required:
        - company
      properties:
        company:
          $ref: "#/components/schemas/Company"
    UpdateCompanyRequest:
      type: object
      additionalProperties:
        $ref: "#/components/schemas/CustomFieldValueInput"
      description: |
        Company update payload. Known system keys, including `tags` and `notes`, are documented below. Any additional top-level key is treated
        as a registered company custom field key, following the same convention as the contact update endpoint.
        Unknown custom field keys, keys that collide with system fields, and values that do not match the
        registered field type are rejected. Provide at least one of `tags`, `notes`, or a custom field key.
      minProperties: 1
      properties:
        account_id:
          type: string
          description: LinkedIn account ID returned by `GET /v1/accounts`. Required to write notes and when the company exists under multiple LinkedIn accounts.
          pattern: "^[1-9][0-9]*$"
        tags:
          $ref: "#/components/schemas/ContactTagsPatch"
        notes:
          $ref: "#/components/schemas/NotesPatch"
    ListContentEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/ListContentResponse"
    ListContentResponse:
      type: object
      additionalProperties: false
      required:
        - content
        - pagination
      properties:
        content:
          type: array
          items:
            $ref: "#/components/schemas/Content"
        pagination:
          $ref: "#/components/schemas/Pagination"
    Content:
      type: object
      additionalProperties: false
      description: |
        A LinkedIn post or comment of one account. `linkedin_url` opens it on LinkedIn. Its engagers are contacts: list them with `GET /v1/contacts?view_id={engagers_view_id}`.
      required:
        - content_id
        - account
        - content_type
        - author
        - linkedin_url
        - posted_at
        - reaction_count
        - comment_count
        - repost_count
        - media_type
        - media
        - source
        - tags
        - engagers_view_id
        - engagers_extracted_at
        - new_comments_since_extraction
        - results
      properties:
        content_id:
          type: string
          example: cnt_0f8fad5bd9cb469fa16570867728950e
        account:
          $ref: "#/components/schemas/AccountSummary"
        content_type:
          type: string
          enum:
            - post
            - comment
        author:
          $ref: "#/components/schemas/ContentAuthor"
        parent:
          $ref: "#/components/schemas/ContentParent"
        text:
          type: string
        linkedin_url:
          type: string
          format: uri
        posted_at:
          type: string
          format: date-time
        reaction_count:
          type: integer
          nullable: true
        comment_count:
          type: integer
          nullable: true
          description: Comments and their replies.
        repost_count:
          type: integer
          nullable: true
        media_type:
          type: string
          enum:
            - none
            - image
            - video
            - document
            - link
        media:
          $ref: "#/components/schemas/ContentMedia"
        source:
          type: string
          description: "`mine` for the account's own posts and comments, `imported` for posts imported with `POST /v1/content/import`, `contact` for content found with `POST /v1/contacts/{contact_id}/find-content`."
          enum:
            - mine
            - imported
            - contact
        tags:
          type: array
          description: Content tags, a pool apart from contact tags.
          items:
            $ref: "#/components/schemas/APITag"
        engagers_view_id:
          type: string
          nullable: true
          description: Contact view of the post's engagers. Null until its engagers were imported.
        engagers_extracted_at:
          type: string
          format: date-time
          nullable: true
          description: When engagers were last imported.
        new_comments_since_extraction:
          type: integer
          nullable: true
          description: Comments added since engagers were last imported, from the last known count.
        results:
          $ref: "#/components/schemas/ContentResults"
    ContentAuthor:
      type: object
      additionalProperties: false
      required:
        - provider_participant_id
        - name
      properties:
        contact_id:
          type: string
          description: Present when the author is a contact of the account.
        provider_participant_id:
          type: string
        name:
          type: string
        headline:
          type: string
        linkedin_url:
          type: string
          format: uri
    ContentParent:
      type: object
      additionalProperties: false
      description: The post a comment is on. Comments only.
      required:
        - linkedin_url
        - author
      properties:
        linkedin_url:
          type: string
          format: uri
        text:
          type: string
        author:
          $ref: "#/components/schemas/ContentAuthor"
    ContentMedia:
      type: object
      additionalProperties: false
      nullable: true
      description: Images, a video's thumbnail, a document's first pages and PDF, or a link preview. Null when `media_type` is `none`.
      required:
        - images
      properties:
        images:
          type: array
          items:
            $ref: "#/components/schemas/ContentMediaImage"
        title:
          type: string
          description: Documents and links.
        subtitle:
          type: string
          description: Links only.
        link_url:
          type: string
          format: uri
          description: Links only.
        page_count:
          type: integer
          description: Documents only.
        document_url:
          type: string
          format: uri
          description: Documents only. The PDF.
    ContentMediaImage:
      type: object
      additionalProperties: false
      required:
        - url
      properties:
        url:
          type: string
          format: uri
        width:
          type: integer
        height:
          type: integer
    ContentResults:
      type: object
      additionalProperties: false
      description: What happened after each engager engaged.
      required:
        - engagers
        - contacted
        - connected
        - replied
      properties:
        engagers:
          type: integer
          description: Contacts with a signal on this content.
        contacted:
          type: integer
          description: Engagers sent a message or connection request afterwards.
        connected:
          type: integer
          description: Engagers connected afterwards.
        replied:
          type: integer
          description: Engagers who replied afterwards.
    SearchPostsRequest:
      type: object
      additionalProperties: false
      description: At least one of `keywords`, `author_linkedin_urls`, `author_company_linkedin_urls`, `author_industries`, `author_keywords` or `mentions`. List filters match any of their values, and posts must match every filter set.
      properties:
        account_id:
          type: string
          description: LinkedIn account ID returned by `GET /v1/accounts`. Required when the organization has multiple LinkedIn accounts.
          pattern: "^[1-9][0-9]*$"
        keywords:
          type: string
          maxLength: 200
          description: Words to search for in posts. Supports LinkedIn's `AND`, `OR` and `NOT`.
        author_linkedin_urls:
          type: array
          maxItems: 20
          description: LinkedIn profile URLs of the posts' authors. For one contact's recent posts, prefer `POST /v1/contacts/{contact_id}/find-content`.
          items:
            type: string
        author_company_linkedin_urls:
          type: array
          maxItems: 20
          description: LinkedIn company page URLs where the authors work.
          items:
            type: string
        author_industries:
          type: array
          maxItems: 20
          description: Industries of the authors' employers, as LinkedIn company pages name them, such as `Software Development`. An unknown one fails with the closest names.
          items:
            type: string
        author_keywords:
          type: string
          maxLength: 200
          description: Words in the authors' profiles, such as `founder`.
        mentions:
          type: array
          maxItems: 20
          description: LinkedIn profile or company page URLs the posts mention.
          items:
            type: string
        media_type:
          type: string
          description: Only posts with an image, a video or a document.
          enum:
            - image
            - video
            - document
        sort:
          type: string
          description: Most relevant first (default) or newest first.
          enum:
            - relevance
            - newest
        posted_within:
          type: string
          description: Only posts from the last 24 hours, week or month.
          enum:
            - 24h
            - week
            - month
        cursor:
          type: string
          description: Cursor returned as `data.pagination.next_cursor` by the previous call. It carries its search, so the filters can be left out; if you pass them, they must be the same.
    SearchPostsEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/SearchPostsResponse"
    SearchPostsResponse:
      type: object
      additionalProperties: false
      required:
        - content
        - total_results
        - pagination
        - charged_credits
      properties:
        content:
          type: array
          items:
            $ref: "#/components/schemas/ContentSearchResult"
        total_results:
          type: integer
          description: Posts LinkedIn counts for this search.
        pagination:
          $ref: "#/components/schemas/Pagination"
        charged_credits:
          type: integer
          format: int64
    ContentSearchResult:
      type: object
      additionalProperties: false
      description: |
        A LinkedIn post found by search. It isn't in TalkToHumans yet, so there is no `content_id`: importing it with `POST /v1/content/import` or `POST /v1/content/engagers/import` adds it.
      required:
        - author
        - linkedin_url
        - posted_at
        - reaction_count
        - comment_count
        - repost_count
        - media_type
      properties:
        author:
          $ref: "#/components/schemas/ContentAuthor"
        text:
          type: string
        linkedin_url:
          type: string
          format: uri
        posted_at:
          type: string
          format: date-time
        reaction_count:
          type: integer
          nullable: true
        comment_count:
          type: integer
          nullable: true
          description: Comments and their replies.
        repost_count:
          type: integer
          nullable: true
        media_type:
          type: string
          enum:
            - none
            - image
            - video
            - document
            - link
    ImportContentRequest:
      type: object
      additionalProperties: false
      required:
        - account_id
        - linkedin_urls
      properties:
        account_id:
          type: string
          description: LinkedIn account ID returned by `GET /v1/accounts`.
          pattern: "^[1-9][0-9]*$"
        linkedin_urls:
          type: array
          minItems: 1
          maxItems: 10
          description: LinkedIn post URLs, such as `linkedin.com/posts/...` or `linkedin.com/feed/update/urn:li:activity:...`, and `lnkd.in` links to them. Duplicates are imported once.
          items:
            type: string
    ImportContentEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/ImportContentResponse"
    ImportContentResponse:
      type: object
      additionalProperties: false
      required:
        - results
        - charged_credits
      properties:
        results:
          type: array
          items:
            $ref: "#/components/schemas/ContentImportResult"
        charged_credits:
          type: integer
    ContentImportResult:
      type: object
      additionalProperties: false
      required:
        - linkedin_url
        - status
        - charged_credits
      properties:
        linkedin_url:
          type: string
          description: LinkedIn post URL as submitted.
        status:
          type: string
          enum:
            - imported
            - failed
        content_id:
          type: string
          description: Present when `status` is `imported`.
        charged_credits:
          type: integer
        error:
          $ref: "#/components/schemas/ContactImportError"
    FindContentRequest:
      type: object
      additionalProperties: false
      properties:
        account_id:
          type: string
          description: LinkedIn account ID returned by `GET /v1/accounts`. Required when the organization has multiple LinkedIn accounts.
          pattern: "^[1-9][0-9]*$"
    FindContentEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/FindContentResponse"
    FindContentResponse:
      type: object
      additionalProperties: false
      required:
        - contact_id
        - account
        - post_count
        - comment_count
        - charged_credits
      properties:
        contact_id:
          type: string
        account:
          $ref: "#/components/schemas/AccountSummary"
        post_count:
          type: integer
          description: Recent posts found.
        comment_count:
          type: integer
          description: Recent comments found.
        charged_credits:
          type: integer
    TrackContentRequest:
      type: object
      additionalProperties: false
      properties:
        account_id:
          type: string
          description: LinkedIn account ID returned by `GET /v1/accounts`. Required when the organization has multiple LinkedIn accounts.
          pattern: "^[1-9][0-9]*$"
        enabled:
          type: boolean
          default: true
          description: "`false` stops tracking and keeps the engagers already imported."
    TrackContentEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/TrackContentResponse"
    TrackContentResponse:
      type: object
      additionalProperties: false
      required:
        - contact_id
        - account
        - content_tracking
      properties:
        contact_id:
          type: string
        account:
          $ref: "#/components/schemas/AccountSummary"
        content_tracking:
          $ref: "#/components/schemas/ContentTracking"
    ContentTracking:
      type: object
      additionalProperties: false
      nullable: true
      description: The daily check of a contact's posts started with `POST /v1/contacts/{contact_id}/track-content`, which imports their engagers into one contact view. Null on a contact whose posts were never tracked.
      required:
        - enabled
        - engagers_view_id
        - last_checked_at
        - last_check_error
      properties:
        enabled:
          type: boolean
        engagers_view_id:
          type: string
          nullable: true
          description: Contact view of the people who engaged with the contact's posts. Pass as `view_id` to `GET /v1/contacts`. Kept after tracking stops.
        last_checked_at:
          type: string
          format: date-time
          nullable: true
          description: When the last daily check ended, or null until the first one ends.
        last_check_error:
          type: string
          nullable: true
          description: Error code of the last check when it failed, such as `billing_insufficient_credits`. The next day's check tries again.
    ImportContentEngagersRequest:
      type: object
      additionalProperties: false
      required:
        - account_id
      properties:
        account_id:
          type: string
          description: LinkedIn account ID returned by `GET /v1/accounts`.
          pattern: "^[1-9][0-9]*$"
        content_id:
          type: string
          description: A post's content ID from `GET /v1/content`. Provide exactly one of `content_id` or `linkedin_url`.
        linkedin_url:
          type: string
          description: A LinkedIn post URL. A post not yet in TalkToHumans is imported first. Provide exactly one of `content_id` or `linkedin_url`.
        include_reactions:
          type: boolean
          deprecated: true
          description: Ignored. The people who reacted are always imported with the commenters.
        estimate_only:
          type: boolean
          default: false
          description: Return `estimated_credits` without importing or spending anything. Needs a post already in TalkToHumans.
    ImportContentEngagersEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/ImportContentEngagersResponse"
    ImportContentEngagersResponse:
      type: object
      additionalProperties: false
      required:
        - import
      properties:
        import:
          $ref: "#/components/schemas/ContentEngagersImport"
    ContentEngagersImport:
      type: object
      additionalProperties: false
      required:
        - import_id
        - content_id
        - engagers_view_id
        - comment_count
        - reaction_count
        - estimated_credits
      properties:
        import_id:
          type: string
          nullable: true
          description: Pass to `GET /v1/contacts/imports/{import_id}` to check progress. Null when `estimate_only` is set or nothing is new.
        content_id:
          type: string
        engagers_view_id:
          type: string
          nullable: true
          description: Contact view of the post's engagers, created when the import starts. Null on an estimate_only call for a post never imported.
        comment_count:
          type: integer
          description: The post's comments, replies included.
        reaction_count:
          type: integer
        estimated_credits:
          type: integer
          description: At most what the import costs, the post's import included. 2 credits per started 100 engagers new to the organization, per engagement type; only new engagers are charged.
    ContentEngagersImportResult:
      type: object
      additionalProperties: false
      description: What a completed engager import did.
      required:
        - content_id
        - engagers_view_id
        - new_contacts
        - signals
        - charged_credits
      properties:
        content_id:
          type: string
        engagers_view_id:
          type: string
          description: Contact view of the post's engagers. Pass as `view_id` to `GET /v1/contacts`.
        new_contacts:
          type: integer
          description: Engagers who weren't contacts yet.
        signals:
          type: integer
          description: Engager signals written.
        charged_credits:
          type: integer
    UpdateContentRequest:
      type: object
      additionalProperties: false
      required:
        - tags
      properties:
        account_id:
          type: string
          description: LinkedIn account ID returned by `GET /v1/accounts`. Required when the organization has multiple LinkedIn accounts.
          pattern: "^[1-9][0-9]*$"
        tags:
          $ref: "#/components/schemas/ContactTagsPatch"
    UpdateContentEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/UpdateContentResponse"
    UpdateContentResponse:
      type: object
      additionalProperties: false
      required:
        - content
      properties:
        content:
          $ref: "#/components/schemas/Content"
    Signal:
      type: object
      additionalProperties: false
      description: A dated reason a contact is worth talking to now.
      required:
        - signal_id
        - signal_type
        - text
        - occurred_at
        - source
      properties:
        signal_id:
          type: string
          example: sig_6b2f0e0c7c8a4d1e9f3a2b1c0d9e8f7a
        signal_type:
          type: string
          description: "`viewed_profile`, `commented_on_my_post`, `reacted_to_my_post`, `commented_on_post`, `reacted_to_post`, or `custom:<name>`."
        text:
          type: string
        comment_text:
          type: string
          description: The comment itself, on comment signals.
        occurred_at:
          type: string
          format: date-time
        content_id:
          type: string
          description: The post engaged with, on engagement signals.
        source:
          type: string
          enum:
            - enrichment
            - linkedin_sync
            - api
            - mcp
            - cli
        key:
          type: string
          description: The key it was created with, on custom signals.
        contact_id:
          type: string
          description: The contact it belongs to, on a company's signals.
    CreateSignalsRequest:
      type: object
      additionalProperties: false
      required:
        - account_id
        - signals
      properties:
        account_id:
          type: string
          description: LinkedIn account ID returned by `GET /v1/accounts`.
          pattern: "^[1-9][0-9]*$"
        signals:
          type: array
          minItems: 1
          maxItems: 500
          items:
            $ref: "#/components/schemas/CreateSignalInput"
    CreateSignalInput:
      type: object
      additionalProperties: false
      required:
        - signal_type
        - text
        - key
      properties:
        contact_id:
          type: string
          description: Contact ID from `GET /v1/contacts`. Provide exactly one of `contact_id` or `linkedin_url`; the contact must already be in the account.
          pattern: "^[1-9][0-9]*$"
        linkedin_url:
          type: string
          description: LinkedIn profile URL of a contact of the account. Provide exactly one of `contact_id` or `linkedin_url`.
        signal_type:
          type: string
          pattern: "^custom:[a-z0-9_]{1,40}$"
          example: custom:event_attended
        text:
          type: string
          minLength: 1
          maxLength: 280
        occurred_at:
          type: string
          format: date-time
          description: When it happened, not in the future. Defaults to now.
        key:
          type: string
          minLength: 1
          maxLength: 200
          description: Your own unique key for this signal. Sending the same key again updates its signal instead of adding one.
    CreateSignalsEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/CreateSignalsResponse"
    CreateSignalsResponse:
      type: object
      additionalProperties: false
      required:
        - created
        - updated
        - errors
      properties:
        created:
          type: integer
        updated:
          type: integer
        errors:
          type: array
          description: Signals that were not written, by their index in `signals`. The others were.
          items:
            $ref: "#/components/schemas/CreateSignalError"
    CreateSignalError:
      type: object
      additionalProperties: false
      required:
        - index
        - code
        - message
      properties:
        index:
          type: integer
        code:
          type: string
          enum:
            - invalid_signal
            - contact_not_found
            - key_conflict
        message:
          type: string
    ListConversationsEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/ListConversationsResponse"
    ListConversationsResponse:
      type: object
      additionalProperties: false
      required:
        - conversations
        - pagination
      properties:
        conversations:
          type: array
          items:
            $ref: "#/components/schemas/Conversation"
        pagination:
          $ref: "#/components/schemas/Pagination"
    CreateMessageDraftEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/CreateMessageDraftResponse"
    CreateMessageDraftResponse:
      type: object
      additionalProperties: false
      required:
        - draft
      properties:
        draft:
          $ref: "#/components/schemas/MessageDraft"
    CreateMessageDraftRequest:
      type: object
      additionalProperties: false
      description: |
        Provide exactly one target: `conversation_id` or `contact_id`. Provide exactly one of `draft_message` (with or without `attachments`), `steps`, `template_id`, `connection_request`, or `clear`.
      required:
        - account_id
      oneOf:
        - required:
            - conversation_id
        - required:
            - contact_id
      properties:
        account_id:
          type: string
          description: LinkedIn account ID returned by `GET /v1/accounts`.
          pattern: "^[1-9][0-9]*$"
        conversation_id:
          type: string
          minLength: 1
          description: Existing conversation ID returned by `GET /v1/conversations`. Provide exactly one target.
        contact_id:
          type: string
          pattern: "^[1-9][0-9]*$"
          description: Contact ID returned by `GET /v1/contacts` or a contact import's results. Provide exactly one target.
        draft_message:
          type: string
          minLength: 1
          description: Plain-text draft. Surrounding whitespace is trimmed and the existing draft for the selected compose context is replaced. Provide exactly one of `draft_message`, `steps`, `template_id`, `connection_request`, or `clear`.
        attachments:
          type: array
          minItems: 1
          description: 'Files the `draft_message` sends, in order, each written as `{"file_id": ...}` from `POST /v1/files`. Can stand without `draft_message`, like a voice message. A message carries up to 20 MB of files and one audio file; InMail carries none. Sequence steps carry their own attachments.'
          items:
            $ref: "#/components/schemas/LinkedInFile"
        steps:
          type: array
          minItems: 1
          description: Ordered sequence steps staged in the conversation for the user to launch in TalkToHumans. Provide exactly one of `draft_message`, `steps`, `template_id`, `connection_request`, or `clear`.
          items:
            $ref: "#/components/schemas/TemplateStep"
        template_id:
          type: string
          minLength: 1
          description: Template ID returned by `GET /v1/templates`. Writes the draft from a message or sequence template. Provide exactly one of `draft_message`, `steps`, `template_id`, `connection_request`, or `clear`.
        connection_request:
          $ref: "#/components/schemas/ConnectionRequestDraft"
        clear:
          type: boolean
          description: Set to `true` to delete the draft of the selected conversation or contact instead of writing one. Succeeds when there is no draft. Provide exactly one of `draft_message`, `steps`, `template_id`, `connection_request`, or `clear`.
        variables:
          type: object
          description: |
            Values for the template's own `{{key}}` variables, keyed by variable key. Only with `template_id`.
            Variables can be left unfilled by omitting them or passing an empty value; they stay in the draft for the user to fill in TalkToHumans. Keys the template does not use return `400 bad_request` listing them.
          additionalProperties:
            type: string
    ConnectionRequestDraft:
      type: object
      additionalProperties: false
      description: A connection request drafted on its own, without a sequence. The user sends it with the Connect button in TalkToHumans. Send `{}` for an invite without a note.
      properties:
        note:
          type: string
          maxLength: 200
          description: Optional invitation note. Contact variables such as `{{first_name}}` are filled when it is sent.
    MessageDraft:
      type: object
      additionalProperties: false
      required:
        - account
        - remaining_variables
        - app_url
        - updated_at
      oneOf:
        - required:
            - conversation_id
        - required:
            - contact_id
      properties:
        conversation_id:
          type: string
          description: Existing TalkToHumans conversation ID when the draft targets a conversation.
        contact_id:
          type: string
          description: TalkToHumans contact ID when the draft targets that contact's compose context.
        account:
          $ref: "#/components/schemas/AccountSummary"
        template_id:
          type: string
          description: Template the draft was written from. Sending the draft from TalkToHumans counts toward the template's statistics.
        draft_message:
          type: string
          description: Normalized plain-text content saved in the composer. Omitted for sequence and connection request drafts.
        attachments:
          type: array
          description: Files the message draft sends, each with a link to open it.
          items:
            $ref: "#/components/schemas/LinkedInFile"
        steps:
          type: array
          description: Sequence steps staged in the conversation, present for sequence drafts. Launch them in TalkToHumans.
          items:
            $ref: "#/components/schemas/TemplateStep"
        connection_request:
          $ref: "#/components/schemas/ConnectionRequestDraft"
        cleared:
          type: boolean
          description: True when the draft was cleared with `clear`. Nothing is drafted there now.
        remaining_variables:
          type: array
          description: |
            `{{key}}` variables still in the draft. Contact and company variables such as `first_name` or `company_name` are filled when the message is sent; other variables must be filled in TalkToHumans before sending.
          items:
            type: string
        app_url:
          type: string
          format: uri
          description: Opens the existing conversation or the new-message composer with the contact selected.
        updated_at:
          type: string
          format: date-time
    ListConversationMessagesEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/ListConversationMessagesResponse"
    ListConversationMessagesResponse:
      type: object
      additionalProperties: false
      required:
        - message_sync_status
        - messages
        - pagination
      properties:
        message_sync_status:
          $ref: "#/components/schemas/MessageSyncStatus"
        messages:
          type: array
          description: Newest first. `pagination.next_cursor` continues to older messages.
          items:
            $ref: "#/components/schemas/ConversationMessage"
        pagination:
          $ref: "#/components/schemas/Pagination"
    ListViewsEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/ListViewsResponse"
    ListViewsResponse:
      type: object
      additionalProperties: false
      required:
        - views
        - pagination
      properties:
        views:
          type: array
          items:
            $ref: "#/components/schemas/View"
        pagination:
          $ref: "#/components/schemas/Pagination"
    View:
      type: object
      additionalProperties: false
      required:
        - id
        - public_id
        - type
        - view_kind
        - name
        - account
        - view_type
        - icon
        - icon_color
        - position
        - filters
        - advanced_filters
        - sorts
        - group_by
        - columns
        - count_mode
        - visibility_mode
        - conversation_open_mode
        - is_hidden
        - app_url
        - created_at
        - updated_at
      properties:
        id:
          type: string
          description: TalkToHumans view ID. Pass as `view_id` to list its conversations, contacts, or companies.
        public_id:
          type: string
          description: Public saved-view ID used in app URLs. Also accepted as `view_id` when unambiguous.
        type:
          type: string
          enum:
            - contact
            - inbox
            - company
            - content
        view_kind:
          type: string
          description: View kind. Contact views use member.
          enum:
            - member
            - inbox
            - company
            - content
        name:
          type: string
        description:
          type: string
          nullable: true
        account:
          $ref: "#/components/schemas/AccountSummary"
        view_type:
          $ref: "#/components/schemas/ViewType"
        icon:
          type: string
          description: Icon shown next to the view's name.
        icon_color:
          $ref: "#/components/schemas/ViewIconColor"
        position:
          type: integer
          minimum: 1
          description: Place among the account's views of the same type in the sidebar, from 1 at the top. Hidden views count.
        filters:
          type: array
          description: Filters shown in the view header. Records match all of them.
          items:
            $ref: "#/components/schemas/ViewFilter"
        advanced_filters:
          allOf:
            - $ref: "#/components/schemas/ViewFilterGroup"
          nullable: true
          description: Advanced filters records must also match, or null.
        sorts:
          type: array
          description: Sort order, first entry first. Empty uses the default order.
          items:
            $ref: "#/components/schemas/ViewSort"
        group_by:
          type: string
          nullable: true
          description: Field inbox conversations are grouped by.
        columns:
          type: array
          nullable: true
          description: Columns shown, left to right, as field keys. Contact and company views only; null for others.
          items:
            type: string
        count_mode:
          $ref: "#/components/schemas/ViewCountMode"
        visibility_mode:
          $ref: "#/components/schemas/ViewVisibilityMode"
        conversation_open_mode:
          $ref: "#/components/schemas/ViewConversationOpenMode"
        is_hidden:
          type: boolean
          description: Hidden views are not shown in the sidebar.
        app_url:
          type: string
          format: uri
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    ViewEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/ViewResponse"
    ViewResponse:
      type: object
      additionalProperties: false
      required:
        - view
      properties:
        view:
          $ref: "#/components/schemas/View"
    ViewFilter:
      type: object
      additionalProperties: false
      required:
        - field
        - operator
      properties:
        field:
          type: string
          description: |
            Field key as `<record>.<field>`. A view filters on its own record and its related records: inboxes on `member.`, `company.`, and `content.`; contact views on `conversation.`, `company.`, and `content.`; company views on `member.`, `conversation.`, and `content.`; content views on the post's author through `member.`, `company.`, and `conversation.`. For example, contacts never messaged: `conversation.has_conversation` `=` `false`.
            Content fields from other views only filter, on the posts their contacts wrote: `content_type`, `media_type`, `text`, `posted_at`, `reaction_count`, `comment_count`, `repost_count`. A content view's author fields filter and sort.
            Conversation fields (`conversation.`): `conversation_type`, `has_conversation`, `reply_state`, `response_status`, `is_scheduled`, `next_scheduled_step_date`, `next_scheduled_step_type`, `schedule_status`, `has_draft`, `last_message_date`, `is_favorite`, `is_archived`, `is_muted`, `is_unread`, `messages`.
            Contact fields (`member.`): `full_name`, `job_title`, `headline`, `follower_count`, `is_enriched`, `is_in_crm`, `work_email`, `phone`, `linkedin_url`, `specific_contacts`, `tags`, `invite_type`, `relationship_status`, `connected_at`, `imported_at`, `imported_source`, `country`, `state`, `city`, `timezone`, `notes`, `invite_received_at`.
            Company fields (`company.`): `company_name`, `industry`, `country`, `state`, `city`, `employee_range`, `employee_count`, `is_in_crm`, `tags`, `notes`.
            Content fields (`content.`): `content_type`, `media_type`, `text`, `author`, `posted_at`, `reaction_count`, `comment_count`, `repost_count`, `source`, `tags`.
            Contact signal fields: `member.signals` (`contains` or `doesNotContain` signal types, `null`, `notNull`) and `member.last_signal_at` (dates). A post's engagers: `member.ce_<content_id>` (`notNull` for engaged, `=` `comment` or `reaction`, `contains` comment keywords).
            Custom fields use `member.custom_fields.<name>` or `company.custom_fields.<name>`.
          example: member.tags
        operator:
          type: string
          enum:
            - "="
            - "!="
            - contains
            - doesNotContain
            - "null"
            - notNull
            - "<"
            - "<="
            - ">"
            - ">="
            - relativeToToday
            - between
            - notBetween
        value:
          description: |
            Omit for `null` and `notNull`. Text and `contains` filters take a list of strings. `tags` takes tag names, `specific_contacts` takes contact IDs from `GET /v1/contacts`, and `industry` takes `industry_urn` values.
            `linkedin_url` takes LinkedIn profile URLs or usernames, and `=` matches any of up to 100. A contact with no readable URL counts as empty.
            `messages` takes `contains` or `doesNotContain` and matches the text of synced messages only.
            Dates take `YYYY-MM-DD`, `{"from", "to"}` for `between`, or `{"direction": "past" | "older_than" | "next" | "this", "amount", "unit": "day" | "week" | "month" | "quarter" | "year"}` for `relativeToToday`. `older_than` matches dates before the `past` range of the same amount: `{"direction": "older_than", "amount": 3, "unit": "day"}` is everything up to three days ago.
    ViewFilterGroup:
      type: object
      additionalProperties: false
      description: Advanced filters, as the app's advanced filter builder saves them. Unlike `filters`, a field can appear in several rules.
      required:
        - rules
      properties:
        combinator:
          $ref: "#/components/schemas/ViewFilterCombinator"
        not:
          type: boolean
          default: false
          description: Match records the group does not match.
        rules:
          type: array
          description: Conditions and nested groups. Empty rules remove the advanced filters.
          items:
            $ref: "#/components/schemas/ViewFilterGroupRule"
    ViewFilterGroupRule:
      type: object
      additionalProperties: false
      description: A condition, with `field`, `operator`, and `value` as in `ViewFilter`, or a nested group, with `combinator`, `not`, and `rules`.
      properties:
        field:
          type: string
          description: For a condition. Field key, as in `ViewFilter`.
        operator:
          type: string
          description: For a condition. Operator, as in `ViewFilter`.
        value:
          description: For a condition. Value to compare, as in `ViewFilter`.
        combinator:
          $ref: "#/components/schemas/ViewFilterCombinator"
        not:
          type: boolean
          description: For a nested group. Match records the group does not match.
        rules:
          type: array
          description: For a nested group. Its conditions and groups.
          items:
            $ref: "#/components/schemas/ViewFilterGroupRule"
    ViewFilterCombinator:
      type: string
      description: Whether records match all rules (`and`) or any of them (`or`).
      enum:
        - and
        - or
      default: and
    ViewSort:
      type: object
      additionalProperties: false
      required:
        - field
        - direction
      properties:
        field:
          type: string
          description: Field key, as in `ViewFilter`, such as `conversation.last_message_date`.
        direction:
          type: string
          enum:
            - asc
            - desc
    ViewIcon:
      type: string
      description: Icon name, such as `star`, `mail`, or `calendar`. Defaults to the view type's icon. An unknown name fails with the list of icons.
    ViewIconColor:
      type: string
      description: Color of the view's icon, from the tag colors. New views default to `grey`. Leave it out unless the view stands for one tag; then use that tag's color.
      enum:
        - green
        - orange
        - blue
        - red
        - purple
        - yellow
        - pink
        - grey
    DeleteViewEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: object
          additionalProperties: false
          required:
            - view_id
            - deleted
          properties:
            view_id:
              type: string
            deleted:
              type: boolean
    ViewType:
      type: string
      description: Layout of contact and company views. Inboxes are always `table` and content views always `feed`.
      enum:
        - table
        - map
        - feed
    ViewCountMode:
      type: string
      description: Count shown next to an inbox in the sidebar.
      enum:
        - unread
        - total
    ViewVisibilityMode:
      type: string
      description: When a view is shown in the sidebar. `when_unread` is for inboxes only.
      enum:
        - always
        - when_unread
        - when_not_empty
    ViewConversationOpenMode:
      type: string
      description: Whether an inbox opens conversations full page or beside the list.
      enum:
        - full
        - side_peek
    CreateViewRequest:
      type: object
      additionalProperties: false
      required:
        - name
      properties:
        account_id:
          type: string
          description: LinkedIn account ID returned by `GET /v1/accounts`. Required when the organization has multiple LinkedIn accounts.
          pattern: "^[1-9][0-9]*$"
        type:
          type: string
          enum:
            - inbox
            - contact
            - company
            - content
          default: contact
        name:
          type: string
          minLength: 1
          maxLength: 120
          description: Name shown in the sidebar, 2 to 4 plain words in sentence case, such as Event leads.
        description:
          type: string
          nullable: true
        view_type:
          $ref: "#/components/schemas/ViewType"
        icon:
          $ref: "#/components/schemas/ViewIcon"
        icon_color:
          $ref: "#/components/schemas/ViewIconColor"
        position:
          type: integer
          minimum: 1
          description: Place among the account's views of the same type in the sidebar, from 1 at the top. Hidden views count. Defaults to the bottom.
        filters:
          type: array
          description: |
            Filters records must all match, one per field.
            New inboxes leave muted conversations out unless a filter uses `is_muted`, and leave archived conversations out when `filters` is omitted.
          items:
            $ref: "#/components/schemas/ViewFilter"
        advanced_filters:
          $ref: "#/components/schemas/ViewFilterGroup"
        sorts:
          type: array
          items:
            $ref: "#/components/schemas/ViewSort"
        group_by:
          type: string
          description: Field to group conversations by, such as `conversation.last_message_date`. Inboxes only.
        columns:
          type: array
          description: Columns to show, left to right, as field keys such as `member.full_name` or `member.custom_fields.<name>`. Pick the 5 to 7 that answer the view's question. Contact and company views only. Defaults to the app's full set of columns, except for contact views filtered on engagement (`member.signals`, `member.last_signal_at`, or a post's `member.ce_<content_id>`), which get `member.full_name`, `member.signals`, `member.headline`, `member.relationship_status`, `conversation.last_message_date` and `member.tags`.
          items:
            type: string
        count_mode:
          $ref: "#/components/schemas/ViewCountMode"
        visibility_mode:
          $ref: "#/components/schemas/ViewVisibilityMode"
        conversation_open_mode:
          $ref: "#/components/schemas/ViewConversationOpenMode"
        is_hidden:
          type: boolean
          default: false
    UpdateViewRequest:
      type: object
      additionalProperties: false
      description: Provide at least one field besides `account_id`. Omitted fields are unchanged.
      properties:
        account_id:
          type: string
          description: LinkedIn account ID returned by `GET /v1/accounts`. Must be the view's account.
          pattern: "^[1-9][0-9]*$"
        name:
          type: string
          minLength: 1
          maxLength: 120
          description: New name, 2 to 4 plain words in sentence case.
        description:
          type: string
          description: An empty string removes the description.
        view_type:
          $ref: "#/components/schemas/ViewType"
        icon:
          $ref: "#/components/schemas/ViewIcon"
        icon_color:
          $ref: "#/components/schemas/ViewIconColor"
        position:
          type: integer
          minimum: 1
          description: New place among the account's views of the same type in the sidebar, from 1 at the top. Hidden views count.
        filters:
          type: array
          description: Replacement for all filters. An empty list removes them.
          items:
            $ref: "#/components/schemas/ViewFilter"
        advanced_filters:
          allOf:
            - $ref: "#/components/schemas/ViewFilterGroup"
          description: Replacement for the advanced filters. Empty rules remove them.
        sorts:
          type: array
          description: Replacement for the sort order. An empty list restores the default order.
          items:
            $ref: "#/components/schemas/ViewSort"
        group_by:
          type: string
          description: Field to group conversations by. An empty string removes grouping. Inboxes only.
        columns:
          type: array
          description: Replacement for the columns shown, left to right. Pick the 5 to 7 that answer the view's question. An empty list restores the default columns, as on create. Contact and company views only.
          items:
            type: string
        count_mode:
          $ref: "#/components/schemas/ViewCountMode"
        visibility_mode:
          $ref: "#/components/schemas/ViewVisibilityMode"
        conversation_open_mode:
          $ref: "#/components/schemas/ViewConversationOpenMode"
        is_hidden:
          type: boolean
    ListTemplatesEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/ListTemplatesResponse"
    ListTemplatesResponse:
      type: object
      additionalProperties: false
      required:
        - templates
        - pagination
      properties:
        templates:
          type: array
          items:
            $ref: "#/components/schemas/Template"
        pagination:
          $ref: "#/components/schemas/Pagination"
    UpdateSequenceRequest:
      type: object
      additionalProperties: false
      required:
        - status
      properties:
        status:
          type: string
          enum:
            - active
            - paused
          description: "`paused` pauses the sequence and `active` resumes it."
    SequenceEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: object
          additionalProperties: false
          required:
            - sequence
          properties:
            sequence:
              $ref: "#/components/schemas/Sequence"
    DeleteSequenceEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: object
          additionalProperties: false
          required:
            - sequence_id
            - deleted
          properties:
            sequence_id:
              type: string
            deleted:
              type: boolean
    TemplateEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/TemplateResponse"
    TemplateResponse:
      type: object
      additionalProperties: false
      required:
        - template
      properties:
        template:
          $ref: "#/components/schemas/Template"
    CreateTemplateRequest:
      type: object
      additionalProperties: false
      required:
        - name
        - type
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 200
          description: Template name shown in TalkToHumans.
        type:
          type: string
          enum:
            - message
            - sequence
        scope:
          type: string
          description: "`shared` for the whole workspace, or `personal` for the API key's or MCP user's own templates."
          enum:
            - shared
            - personal
          default: shared
        content:
          type: string
          minLength: 1
          description: |
            Plain-text message. Required for message templates and not allowed for sequence templates.
            Use contact and company variables such as `{{first_name}}` or `{{company_name}}`, or your own `{{key}}` variables filled when drafting.
        steps:
          type: array
          minItems: 1
          description: Ordered steps. Required for sequence templates and not allowed for message templates.
          items:
            $ref: "#/components/schemas/TemplateStep"
    UpdateTemplateRequest:
      type: object
      additionalProperties: false
      description: Provide at least one of `name`, `content`, or `steps`. Omitted fields are unchanged.
      minProperties: 1
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 200
          description: Template name shown in TalkToHumans.
        content:
          type: string
          minLength: 1
          description: Plain-text message. Message templates only.
        steps:
          type: array
          minItems: 1
          description: Replacement for all steps, including their attachments. Sequence templates only.
          items:
            $ref: "#/components/schemas/TemplateStep"
    Template:
      type: object
      additionalProperties: false
      required:
        - template_id
        - name
        - type
        - scope
        - created_at
        - updated_at
      properties:
        template_id:
          type: string
          description: Template ID. Pass as `template_id` to `POST /v1/conversations/drafts` to write a draft from this template.
        name:
          type: string
        type:
          type: string
          enum:
            - message
            - sequence
        scope:
          type: string
          description: Shared templates are visible to the whole workspace. Personal templates are visible only to their owner.
          enum:
            - shared
            - personal
        content:
          type: string
          description: Plain-text message, present for message templates.
        steps:
          type: array
          description: Ordered steps, present for sequence templates.
          items:
            $ref: "#/components/schemas/TemplateStep"
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    TemplateStep:
      type: object
      additionalProperties: false
      required:
        - type
        - delay_minutes
      properties:
        type:
          type: string
          enum:
            - message
            - connection_request
        delay_minutes:
          type: integer
          minimum: 0
          description: Minutes to wait after the previous step, or after launch for the first step.
        content:
          type: string
          description: Plain-text message, required for message steps without attachments. For connection requests, the optional note, up to 200 characters.
        attachments:
          type: array
          description: 'Files a message step sends, in order, each written as `{"file_id": ...}` from `POST /v1/files`. Reads also give each file''s details and a link to open it. Writing steps replaces their attachments too, so keep the ones to send. Message steps only.'
          items:
            $ref: "#/components/schemas/LinkedInFile"
    LinkedInFile:
      type: object
      additionalProperties: false
      description: An uploaded file. Writes read only `file_id`.
      required:
        - file_id
      properties:
        file_id:
          type: string
          description: File ID returned by `POST /v1/files`.
        kind:
          type: string
          description: "`file` is a PDF."
          enum:
            - image
            - video
            - audio
            - file
        file_name:
          type: string
        mime_type:
          type: string
        size_bytes:
          type: integer
        duration_ms:
          type: integer
          description: Length of a video or audio file in milliseconds, when known.
        width:
          type: integer
        height:
          type: integer
        url:
          type: string
          format: uri
          description: Link to open the file, valid for an hour.
    UploadFileForm:
      type: object
      additionalProperties: false
      description: The file itself, sent as `multipart/form-data`.
      required:
        - file
      properties:
        file:
          type: string
          format: binary
          description: "The file: an image (such as a GIF), a video, a PDF, or M4A audio, up to 20 MB."
    UploadFileRequest:
      type: object
      additionalProperties: false
      description: Provide exactly one of `url` or `file_name`.
      properties:
        url:
          type: string
          format: uri
          description: "Public https link to the file: an image (such as a GIF), a video, a PDF, or M4A audio, up to 20 MB."
        file_name:
          type: string
          description: Name of a local file, such as `report.pdf`, to get a link that uploads it. For agents whose shell has no API key, like an MCP client's.
    UploadFileEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          $ref: "#/components/schemas/UploadFileResponse"
    UploadFileResponse:
      type: object
      additionalProperties: false
      description: "`file` once a file is uploaded; `upload` for a `file_name` request."
      properties:
        file:
          $ref: "#/components/schemas/LinkedInFile"
        upload:
          $ref: "#/components/schemas/FileUploadLink"
    FileUploadLink:
      type: object
      additionalProperties: false
      required:
        - url
        - command
        - expires_at
      properties:
        url:
          type: string
          format: uri
          description: Link that takes the file as `multipart/form-data` in a field named `file`.
        command:
          type: string
          description: curl command that uploads the file. Run it with the file's path.
        expires_at:
          type: string
          format: date-time
          description: When the link stops working.
    Pagination:
      type: object
      additionalProperties: false
      required:
        - limit
        - has_more
      properties:
        limit:
          type: integer
          format: int32
          example: 10
        has_more:
          type: boolean
        next_cursor:
          type: string
          description: Cursor for the next page. Omitted when there are no more results.
    AccountSummary:
      type: object
      additionalProperties: false
      required:
        - account_id
        - display_name
        - provider_account_id
        - owner_user_id
      properties:
        account_id:
          type: string
          description: TalkToHumans account ID.
        display_name:
          type: string
        provider_account_id:
          type: string
          description: LinkedIn provider account ID.
        owner_user_id:
          type: string
          description: TalkToHumans user ID that owns the account.
    Account:
      type: object
      additionalProperties: false
      required:
        - account_id
        - display_name
        - provider_account_id
        - owner_user_id
        - sync
        - premium
        - sales_navigator
      properties:
        account_id:
          type: string
          description: TalkToHumans account ID.
        display_name:
          type: string
        provider_account_id:
          type: string
          description: LinkedIn provider account ID.
        owner_user_id:
          type: string
          description: TalkToHumans user ID that owns the account.
        contact_id:
          type: string
          description: The account's own LinkedIn profile as a contact ID, for `POST /v1/contacts/{contact_id}/find-content` on the user's own posts and comments. Missing until the profile is known.
        sync:
          $ref: "#/components/schemas/AccountSync"
        premium:
          $ref: "#/components/schemas/AccountPremium"
        sales_navigator:
          $ref: "#/components/schemas/AccountSalesNavigator"
        profile:
          $ref: "#/components/schemas/AccountProfile"
    AccountProfile:
      type: object
      additionalProperties: false
      description: The user's own LinkedIn profile, as context for recommendations. Missing until the profile is known. Until it's fetched (`fetched_at` null), only the name, headline and URL are filled in.
      required:
        - name
        - languages
        - experiences
        - educations
        - locations
        - fetched_at
      properties:
        name:
          type: string
        headline:
          type: string
        primary_role_title:
          type: string
        primary_company_name:
          type: string
        linkedin_url:
          type: string
          format: uri
        about:
          type: string
        follower_count:
          type: integer
          nullable: true
        connections_count:
          type: integer
          nullable: true
        languages:
          type: array
          items:
            $ref: "#/components/schemas/Language"
        experiences:
          type: array
          items:
            $ref: "#/components/schemas/Experience"
        educations:
          type: array
          items:
            $ref: "#/components/schemas/Education"
        locations:
          type: array
          items:
            $ref: "#/components/schemas/Location"
        company:
          $ref: "#/components/schemas/Company"
        fetched_at:
          type: string
          format: date-time
          nullable: true
          description: When TalkToHumans last fetched the full profile, or null if it hasn't yet. It refreshes in the background every 30 days.
    AccountPremium:
      type: object
      additionalProperties: false
      description: Whether the account pays for LinkedIn Premium, Sales Navigator or Recruiter.
      required:
        - status
        - checked_at
      properties:
        status:
          type: string
          description: "`premium` when the account pays for LinkedIn Premium, Sales Navigator or Recruiter, `free` when it doesn't, `unknown` until the TalkToHumans extension checked."
          enum:
            - premium
            - free
            - unknown
        checked_at:
          type: string
          format: date-time
          nullable: true
          description: When the TalkToHumans extension last checked, or null if it never did. It checks once a day.
    AccountSalesNavigator:
      type: object
      additionalProperties: false
      description: Whether the account has a Sales Navigator seat, and its InMail credits.
      required:
        - status
        - inmail_credits
        - checked_at
      properties:
        status:
          type: string
          description: "`active` when the account has a Sales Navigator seat, `none` when it doesn't, `unknown` until the TalkToHumans extension checked."
          enum:
            - active
            - none
            - unknown
        inmail_credits:
          type: integer
          nullable: true
          description: InMail credits left, or null until the TalkToHumans extension read them.
        checked_at:
          type: string
          format: date-time
          nullable: true
          description: When the TalkToHumans extension last checked, or null if it never did. It checks once a day.
    AccountSync:
      type: object
      additionalProperties: false
      required:
        - status
        - last_synced_at
        - inbox
        - invitations
        - sent_invitations
        - connections
      properties:
        status:
          type: string
          description: "`fresh` when the TalkToHumans extension synced every list below in the last 24 hours, otherwise `stale`. Data of a stale account may be out of date."
          enum:
            - fresh
            - stale
        last_synced_at:
          type: string
          format: date-time
          nullable: true
          description: When every list below was last synced, or null if one never was.
        inbox:
          $ref: "#/components/schemas/ListSync"
        invitations:
          $ref: "#/components/schemas/ListSync"
        sent_invitations:
          $ref: "#/components/schemas/ListSync"
        connections:
          $ref: "#/components/schemas/ListSync"
    ListSync:
      type: object
      additionalProperties: false
      description: Sync status of one LinkedIn list. Anything newer than `last_synced_at` is not in TalkToHumans yet.
      required:
        - last_synced_at
        - next_sync_by
        - fully_loaded
      properties:
        last_synced_at:
          type: string
          format: date-time
          nullable: true
          description: When the newest items were last fetched, or null if never.
        next_sync_by:
          type: string
          format: date-time
          nullable: true
          description: Latest time of the next fetch while the TalkToHumans extension runs. A past time means it isn't running. Null if never synced.
        fully_loaded:
          type: boolean
          description: "`true` once older history is loaded too."
    Contact:
      type: object
      additionalProperties:
        $ref: "#/components/schemas/CustomFieldValue"
      description: |
        LinkedIn contact. Registered custom field values may appear as additional top-level properties using
        each custom field's `key`, alongside the system fields documented below.
      required:
        - account_relationship_id
        - contact_id
        - contact_enrichment
        - provider_participant_id
        - account
        - name
        - relationship_status
        - tags
        - notes
        - languages
        - experiences
        - educations
        - locations
        - app_url
      properties:
        account_relationship_id:
          type: string
        contact_id:
          type: string
          description: TalkToHumans contact ID.
        provider_participant_id:
          type: string
          description: LinkedIn participant ID.
        public_identifier:
          type: string
        account:
          $ref: "#/components/schemas/AccountSummary"
        name:
          type: string
        first_name:
          type: string
        last_name:
          type: string
        headline:
          type: string
        primary_role_title:
          type: string
        primary_company_name:
          type: string
        contact_enrichment:
          $ref: "#/components/schemas/ContactEnrichment"
        work_email:
          type: string
          description: Work email when email enrichment was found for this organization.
        phone:
          type: string
          description: Mobile phone number when phone enrichment was found for this organization.
        linkedin_url:
          type: string
          format: uri
        avatar_url:
          type: string
          format: uri
        background_cover_url:
          type: string
          format: uri
        about:
          type: string
        profile_action_label:
          type: string
        profile_action_url:
          type: string
          format: uri
        follower_count:
          type: integer
          nullable: true
        connections_count:
          type: integer
          nullable: true
        relationship_status:
          $ref: "#/components/schemas/RelationshipStatus"
        connection_invitation:
          $ref: "#/components/schemas/ConnectionInvitation"
        tags:
          type: array
          items:
            $ref: "#/components/schemas/APITag"
        notes:
          type: array
          description: Notes, newest first. Empty when there are no notes.
          items:
            $ref: "#/components/schemas/Note"
        languages:
          type: array
          items:
            $ref: "#/components/schemas/Language"
        experiences:
          type: array
          items:
            $ref: "#/components/schemas/Experience"
        educations:
          type: array
          items:
            $ref: "#/components/schemas/Education"
        locations:
          type: array
          items:
            $ref: "#/components/schemas/Location"
        company:
          $ref: "#/components/schemas/Company"
        last_interaction_at:
          type: string
          format: date-time
          nullable: true
        signals:
          type: array
          description: The contact's newest 20 signals, newest first. Filter on `member.signals` or `member.last_signal_at`.
          items:
            $ref: "#/components/schemas/Signal"
        last_signal_at:
          type: string
          format: date-time
          nullable: true
          description: When the contact's latest signal happened.
        content_tracking:
          $ref: "#/components/schemas/ContentTracking"
        sequence:
          $ref: "#/components/schemas/Sequence"
        draft:
          $ref: "#/components/schemas/MessageDraft"
        app_url:
          type: string
          format: uri
          description: Opens the contact in TalkToHumans.
    ContactSummary:
      type: object
      additionalProperties:
        $ref: "#/components/schemas/CustomFieldValue"
      description: |
        Compact LinkedIn contact returned by write endpoints: identity plus every value you can change or look up. Use `GET /v1/contacts` for profile history and company details.
        Registered custom field values may appear as additional top-level properties using each custom field's `key`, alongside the system fields documented below.
      required:
        - contact_id
        - account
        - name
        - relationship_status
        - contact_enrichment
        - tags
        - notes
        - app_url
      properties:
        contact_id:
          type: string
          description: TalkToHumans contact ID.
        account:
          $ref: "#/components/schemas/AccountSummary"
        name:
          type: string
        first_name:
          type: string
        last_name:
          type: string
        headline:
          type: string
        primary_role_title:
          type: string
        primary_company_name:
          type: string
        linkedin_url:
          type: string
          format: uri
        relationship_status:
          $ref: "#/components/schemas/RelationshipStatus"
        work_email:
          type: string
          description: Work email when email enrichment was found for this organization.
        phone:
          type: string
          description: Mobile phone number when phone enrichment was found for this organization.
        contact_enrichment:
          $ref: "#/components/schemas/ContactEnrichment"
        tags:
          type: array
          items:
            $ref: "#/components/schemas/APITag"
        notes:
          type: array
          description: Notes, newest first. Empty when there are no notes.
          items:
            $ref: "#/components/schemas/Note"
        app_url:
          type: string
          format: uri
          description: Opens the contact in TalkToHumans.
    Conversation:
      type: object
      additionalProperties: false
      required:
        - conversation_id
        - account
        - title
        - is_group
        - conversation_type
        - participants
        - message_sync_status
        - app_url
      properties:
        conversation_id:
          type: string
          description: TalkToHumans conversation ID.
        account:
          $ref: "#/components/schemas/AccountSummary"
        title:
          type: string
        is_group:
          type: boolean
        conversation_type:
          type: string
          description: "`linkedin_message` for a message, `sales_navigator_inmail` or `recruiter_inmail` for an InMail."
          enum:
            - linkedin_message
            - sales_navigator_inmail
            - recruiter_inmail
        participants:
          type: array
          items:
            $ref: "#/components/schemas/ConversationParticipant"
        last_message_text:
          type: string
        last_message_direction:
          type: string
          enum:
            - sent
            - received
            - ""
        last_message_at:
          type: string
          format: date-time
          nullable: true
        current_state:
          type: string
        sequence:
          $ref: "#/components/schemas/Sequence"
        draft:
          $ref: "#/components/schemas/MessageDraft"
        message_sync_status:
          $ref: "#/components/schemas/MessageSyncStatus"
        app_url:
          type: string
          format: uri
    MessageSyncStatus:
      type: string
      description: |
        Whether the conversation's recent messages are synced. TalkToHumans reads conversations gradually, newest first, a few at a time while the user's browser is open.
        - `synced`: recent messages are up to date.
        - `outdated`: a newer message is still syncing.
        - `not_synced`: no message has been synced yet.

        Only recent messages sync automatically; older history loads when the conversation is opened in TalkToHumans. While the status is not `synced`, messages may be incomplete.
      enum:
        - synced
        - outdated
        - not_synced
    ConversationParticipant:
      type: object
      additionalProperties: false
      required:
        - contact_id
        - provider_participant_id
        - name
        - relationship_status
      properties:
        account_relationship_id:
          type: string
        contact_id:
          type: string
        provider_participant_id:
          type: string
        public_identifier:
          type: string
        name:
          type: string
        first_name:
          type: string
        last_name:
          type: string
        headline:
          type: string
        primary_role_title:
          type: string
        primary_company_name:
          type: string
        linkedin_url:
          type: string
          format: uri
        avatar_url:
          type: string
          format: uri
        relationship_status:
          $ref: "#/components/schemas/RelationshipStatus"
    ConversationMessage:
      type: object
      additionalProperties: false
      required:
        - message_id
        - provider_message_id
        - conversation_id
        - direction
        - sent_at
        - is_edited
        - is_deleted
        - attachments
      properties:
        message_id:
          type: string
          description: TalkToHumans message ID.
        provider_message_id:
          type: string
          description: LinkedIn provider message ID.
        conversation_id:
          type: string
          description: TalkToHumans conversation ID.
        text:
          type: string
        direction:
          type: string
          enum:
            - sent
            - received
        sent_at:
          type: string
          format: date-time
        is_edited:
          type: boolean
        is_deleted:
          type: boolean
        sender_participant_id:
          type: string
          description: LinkedIn participant ID for the sender when available.
        attachments:
          type: array
          items:
            $ref: "#/components/schemas/ConversationMessageAttachment"
    ConversationMessageAttachment:
      type: object
      additionalProperties: false
      required:
        - attachment_id
        - kind
        - sort_order
      properties:
        attachment_id:
          type: string
          description: TalkToHumans attachment ID.
        provider_attachment_id:
          type: string
          description: LinkedIn provider attachment ID.
        kind:
          type: string
        sort_order:
          type: integer
          format: int32
        title:
          type: string
        subtitle:
          type: string
        description:
          type: string
        url:
          type: string
          format: uri
        thumbnail_url:
          type: string
          format: uri
        mime_type:
          type: string
        file_name:
          type: string
        size_bytes:
          type: integer
          format: int32
        width:
          type: integer
          format: int32
        height:
          type: integer
          format: int32
        duration_ms:
          type: integer
          format: int32
    RelationshipStatus:
      type: string
      enum:
        - connected
        - not_connected
        - unknown
    ConnectionInvitation:
      type: object
      additionalProperties: false
      nullable: true
      required:
        - status
        - direction
      properties:
        status:
          type: string
          enum:
            - pending
        direction:
          type: string
          enum:
            - incoming
            - outgoing
            - unknown
        invite_id:
          type: string
        invite_state:
          type: string
        invite_type:
          type: string
        received_at:
          type: string
          format: date-time
          nullable: true
    APITag:
      type: object
      additionalProperties: false
      required:
        - name
        - color
      properties:
        name:
          type: string
        color:
          type: string
          enum:
            - green
            - orange
            - blue
            - red
            - purple
            - yellow
            - pink
            - grey
    Language:
      type: object
      additionalProperties: false
      required:
        - language
      properties:
        language:
          type: string
    Experience:
      type: object
      additionalProperties: false
      required:
        - experience_id
        - is_current
      properties:
        experience_id:
          type: string
        company_participant_id:
          type: string
        company_provider_participant_id:
          type: string
        company_name:
          type: string
        title:
          type: string
        employment_type:
          type: string
        location:
          type: string
        start_at:
          type: string
        end_at:
          type: string
        is_current:
          type: boolean
        description:
          type: string
    Education:
      type: object
      additionalProperties: false
      required:
        - education_id
      properties:
        education_id:
          type: string
        school_participant_id:
          type: string
        school_provider_participant_id:
          type: string
        school_name:
          type: string
        degree:
          type: string
        field_of_study:
          type: string
        start_at:
          type: string
        end_at:
          type: string
        description:
          type: string
    Location:
      type: object
      additionalProperties: false
      required:
        - is_primary
        - is_headquarter
      properties:
        linkedin_text:
          type: string
        display_text:
          type: string
        country_code:
          type: string
        region_code:
          type: string
        country:
          type: string
        country_full:
          type: string
        state:
          type: string
        city:
          type: string
        geographic_area:
          type: string
        is_primary:
          type: boolean
        is_headquarter:
          type: boolean
    Industry:
      type: object
      additionalProperties: false
      properties:
        name:
          type: string
        title:
          type: string
        industry_urn:
          type: string
        provider_industry_id:
          type: string
        hierarchy:
          type: string
    Company:
      type: object
      additionalProperties:
        $ref: "#/components/schemas/CustomFieldValue"
      description: |
        A company.
      nullable: true
      required:
        - company_id
        - provider_participant_id
        - name
        - notes
        - industries
        - locations
        - app_url
      properties:
        company_id:
          type: string
        provider_participant_id:
          type: string
        public_identifier:
          type: string
        name:
          type: string
        headline:
          type: string
        linkedin_url:
          type: string
          format: uri
        avatar_url:
          type: string
          format: uri
        background_cover_url:
          type: string
          format: uri
        headcount:
          type: string
        employee_count:
          type: integer
          nullable: true
        founding_date:
          type: string
        website_url:
          type: string
          format: uri
        follower_count:
          type: integer
          nullable: true
        about:
          type: string
        notes:
          type: array
          description: Notes, newest first. Empty when there are no notes.
          items:
            $ref: "#/components/schemas/Note"
        industries:
          type: array
          items:
            $ref: "#/components/schemas/Industry"
        locations:
          type: array
          items:
            $ref: "#/components/schemas/Location"
        app_url:
          type: string
          format: uri
          description: Opens the company in TalkToHumans.
        tags:
          type: array
          description: Tags
          items:
            $ref: "#/components/schemas/APITag"
        signals:
          type: array
          description: The newest 20 signals of the company's contacts, each with its `contact_id`. On `GET /v1/companies` and `PATCH /v1/companies/{company_id}` only.
          items:
            $ref: "#/components/schemas/Signal"
    Sequence:
      type: object
      additionalProperties: false
      nullable: true
      required:
        - sequence_id
        - status
        - stop_if_person_replies
        - steps
      properties:
        sequence_id:
          type: string
        status:
          type: string
          enum:
            - active
            - paused
        stop_if_person_replies:
          type: boolean
        reply_guard_after:
          type: string
          format: date-time
          nullable: true
        next_step_id:
          type: string
        next_step_scheduled_for:
          type: string
          format: date-time
          nullable: true
        steps:
          type: array
          items:
            $ref: "#/components/schemas/SequenceStep"
    SequenceStep:
      type: object
      additionalProperties: false
      required:
        - step_id
        - step_type
        - trigger_type
        - position
        - message_mode
        - state
      properties:
        step_id:
          type: string
        template_run_public_id:
          type: string
        template_id:
          type: string
          description: Template the step was launched from.
        template_name:
          type: string
          description: Name of that template, when you can see it.
        step_type:
          type: string
        trigger_type:
          type: string
        position:
          type: integer
          format: int32
        scheduled_for:
          type: string
          format: date-time
          nullable: true
        message_mode:
          type: string
        state:
          type: string
        content:
          type: string
          description: Plain-text message, or the connection request note, the step will send.
        attachments:
          type: array
          description: Files the step sends, each with a link to open it.
          items:
            $ref: "#/components/schemas/LinkedInFile"
    ListSkillsEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: object
          additionalProperties: false
          required:
            - skills
          properties:
            skills:
              type: array
              items:
                $ref: "#/components/schemas/SkillSummary"
    SkillSummary:
      type: object
      additionalProperties: false
      required:
        - name
        - use_when
      properties:
        name:
          type: string
        use_when:
          type: string
          description: When an agent should read this skill.
    SkillEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: object
          additionalProperties: false
          required:
            - name
            - skill
          properties:
            name:
              type: string
            skill:
              type: string
              description: The playbook as markdown.
    SendFeedbackRequest:
      type: object
      additionalProperties: false
      required:
        - kind
        - message
      properties:
        kind:
          type: string
          enum: [bug, missing, confusing, praise]
          description: "bug: something broke or returned wrong data. missing: something no endpoint or tool can do. confusing: a description or parameter was unclear. praise: something worked well."
        message:
          type: string
          maxLength: 2000
          description: What happened, concretely but in general terms. Longer messages are truncated.
        tool:
          type: string
          maxLength: 100
          description: Optional endpoint, CLI command or MCP tool this is about.
    SendFeedbackEnvelope:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: object
          additionalProperties: false
          required:
            - sent
          properties:
            sent:
              type: boolean
